summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Prevent child process falling to defunct stateAnoop C S2018-08-091-0/+2
| | | | | | | | | | | | Parent process does not wait for child process(which gets forked after accepting a client connection) to exit inside echo server which in turn puts child into defunct state. Even though those defunct childs are cleaned up during parent exit it is better to wait from parent process itself. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add missing header for IPPROTO_TCPAndreas Schneider2018-08-091-0/+1
| | | | | | | This fixes the build on FreeBSD. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix resouce leak in echo_srv tcp handlingAndreas Schneider2018-05-041-2/+1
| | | | | | | CID 175587 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* cmake: Run threaded tests with helgrindAndreas Schneider2018-05-031-6/+35
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add test case to validate free-list indexesAnoop C S2018-05-022-1/+76
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: New threaded test casesAnoop C S2018-05-025-1/+591
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Modify echo server to accept multiple connectionsAnoop C S2018-05-021-23/+35
| | | | | | | | | | In context of multiple threads, echo server must be capable of accepting connections in a loop rather than be satisfied with one incoming connection. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add new test to check mutex lock contentionMichael Adam2018-05-022-1/+74
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: set errno to ENFILE if there is no more free socket_infoMichael Adam2018-05-021-2/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Increase wait time for setup and teardown to 5msAndreas Schneider2018-05-021-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Remove extra test by moving getsockname() to anotherAnoop C S2018-03-263-70/+2
| | | | | | | | | | | | | | test_echo_tcp_socket currently tests socket() and getsockname() network calls. The test name was misleading as it does not require echo server to be setup. Moreover it failed to create socket_wrapper directory which is the pre-requisite for testing with libsocket_wrapper. Therefore it is better to integrate getsockname() test into existing test_tcp_listen test and remove useless test_echo_tcp_socket Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* tests: Add a thread deadlock reproducerAndreas Schneider2017-12-043-1/+175
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix sa_socklen for sockaddr_inAndreas Schneider2017-12-041-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add a simple fnctl() testAndreas Schneider2017-09-072-0/+68
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix test_close_failure test caseMichael Adam2017-03-171-3/+1
| | | | | | | Found by valgrind. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Increase wait time during echo_server's pid-file checkAnoop C S2017-02-271-1/+1
| | | | | | | | | | | | We used to sleep for 200 microseconds in each iteration for checking the existence of echo server's pid file which seems to be very short. In order to avoid chances of failures to detect this pid file within 100 such iterations its better to increase this wait time to 2000 microseconds. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Avoid mutex lock wait in socket close failureAnoop C S2017-02-102-1/+52
| | | | | | | | | | | | | | | In case of absence to close a socket fd during an exit from application we try to close the same by traversing the socket_fds in swrap_destructor. But the early lock taken on libc_symbol_binding_mutex inside the destructor blocks the subsequent request for locking the same while loading libc_close within swrap_close. Also added a test case to verify this flaw in destructor. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Clean-up max_sockets test caseAnoop C S2016-10-271-20/+4
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* cmake: Link pthread library headersMichael Adam2016-10-201-1/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add a test for max_socketsMichael Adam2016-10-202-1/+112
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: Add test case to validate oldfd = newfd case in dup2()Anoop C S2016-08-232-0/+51
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add test_connect_sendto_null_ipv4() testAndreas Schneider2016-05-171-0/+52
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Add a udp test case for sendto() after a connect()Richard Sharpe2016-05-171-0/+52
| | | | | | | | | | Here, we do the same as net ads dns gethostbyname. That is, we connect on a UDP socket and then send a sendto with a dest address (the same as the one we connected on.) and then a recvfrom etc. Signed-of-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Add test for ephemeral port binding in listen()Andreas Schneider2015-11-042-0/+116
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add valgrind suppression file for dlopen() issuesAndreas Schneider2015-10-281-0/+16
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Use a short torture socket dirAndreas Schneider2015-10-271-1/+1
| | | | | | | | | This makes sure we do not run into a regression. Thanks to Grigorij Demidov <grigorii.demidov@nic.cz> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix compile warningAndreas Schneider2015-10-191-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Add a unit test for wrap_sendmsg_filter_cmsghdr()Ralph Boehme2015-10-142-1/+122
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add test for TCP_NODELAY setsockopt()Andreas Schneider2015-10-141-0/+11
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add test for TCP_NODELAY getsockopt()Andreas Schneider2015-10-141-0/+38
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Rename s_addr to send_addrAndreas Schneider2015-08-172-20/+20
| | | | | | The preprocessor on Solaris replaces s_addr with S_un.S_addr. Signed-off-by: Andreas Schneider <asn@samba.org>
* tests: Fix memset() call in new testsAndreas Schneider2015-08-172-4/+4
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* tests: Fix passing pointer of incompatible typeAndreas Schneider2015-08-173-3/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* tests: Add tcp sendmsg/recvmsg testAndreas Schneider2015-08-112-0/+274
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Tests for msg_name(len) in sendmsg/revcmsgAndreas Schneider2015-08-111-0/+196
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix testname of sendmsg testsAndreas Schneider2015-08-111-4/+4
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Migrate to new cmocka APIAndreas Schneider2015-08-1112-100/+184
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* torture: Increase time to wait for pid file.Andreas Schneider2014-12-161-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: Check the return code of kill().Andreas Schneider2014-10-201-4/+16
| | | | | | | CID #73654 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* tests: Add missing breaks in sockaddr assert functions.Andreas Schneider2014-09-031-0/+4
| | | | | | | | CID #72657 CID #72656 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Pass the sockaddr structure to system functions.Andreas Schneider2014-09-023-4/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* echo_srv: Silence alignment warnings.Andreas Schneider2014-09-021-4/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* echo_srv: Fix type punning warnings.Andreas Schneider2014-09-011-88/+86
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix type punning warnings.Andreas Schneider2014-09-0112-378/+477
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Define _GNU_SOURCE on one place only.Jakub Hrozek2014-08-151-1/+0
| | | | | | | | | | There were several _GNU_SOURCE definitions scaterred in the build system. This patch always adds -D_GNU_SOURCE to the CFLAGS if building on a UNIX platform. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* SO_PROTOCOL is platform-dependentJakub Hrozek2014-07-291-1/+9
| | | | | | | | | SO_PROTOCOL is not defined on all platforms. In particular, OSX doesn't include it and so far I haven't found any compatible declaration. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: add HAVE_IPV6 guard to torture_server_address()Michael Adam2014-07-091-0/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Disable addr_in_use bind test while the swrap code is incomplete.Andreas Schneider2014-06-051-0/+4
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Fix conflicting variable name on Solaris.Andreas Schneider2014-06-021-7/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Fix building without bindresvport().Andreas Schneider2014-06-021-1/+8
| | | | | | | This fixes the build on Solaris. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>