summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* tests: add new test test_bind_ipv4_addr_in_use()Michael Adam2014-06-011-0/+157
| | | | | | | This tests binding an address that is already in use. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: extend the ipv6 bind testMichael Adam2014-06-011-0/+23
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: greatly extend the ipv4 bind testMichael Adam2014-06-011-0/+88
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Avoid using getenv() to retrieve the path.Andreas Schneider2014-06-011-7/+7
| | | | | | | CID 17221 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: add check for rpc/rpc.h - needed on freebsd for bindresvportMichael Adam2014-06-011-0/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add tests for bindresvport().Andreas Schneider2014-05-311-0/+113
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add tests for bind().Andreas Schneider2014-05-312-0/+111
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add test that getsockname is correct after socket().Andreas Schneider2014-05-312-0/+70
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* torture: Wait for the pidfile and then start the tests.Andreas Schneider2014-05-311-1/+13
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* echo_srv: Write pidfile after we setup the listeners.Andreas Schneider2014-05-311-9/+11
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Fix possible format string attack.Andreas Schneider2014-05-271-6/+3
| | | | | | | | | | Well, there is really not attack on a test but we want to silence Coverity :) CID 17221 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add more tests for socket options.Andreas Schneider2014-05-261-0/+147
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>