summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* swrap: introduce a socket_wrapper_noop.so and socket_wrapper.h to provide ↵Stefan Metzmacher2021-03-151-1/+2
| | | | | | | | | | | | noop stubs Applications with the need to call socket_wrapper_enabled() should link against -lsocket_wrapper_noop in order to resolve the symbol at link time. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14640 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: add basic support for fd-passing via SCM_RIGHTSStefan Metzmacher2021-02-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | We only allow passing up to 6 fds in a single sendmsg call, in order to keep the logic simple. That's more than enough for Samba's use of fd-passing, there we only pass a single fd and the fd will be closed in the sender on success. It means it's ok to keep the socket_info.io.pck_{snd,rcv} fields per process and the PCAP generation will still work as expected. If these constraints turn out to be a problem for other applications, we need to change to a more complex design and move the socket_info array into a shared memory file and use shared robust mutexes. But for now we just want to support multi-channel testing in Samba. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11899 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add test for socket_wrapper fd-passing supportAnoop C S2021-02-021-1/+5
| | | | | Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* gitlab-ci: Add job for ThreadSanitizerAndreas Schneider2021-01-291-0/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* cmake: Disable deep binding for helgrindAndreas Schneider2019-02-121-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Enable threaded test cases on FreeBSDAnoop C S2018-11-121-12/+0
| | | | | | | | | It was previously judged as a bug which now turned to be due to wrong backlog count set in echo_srv while listening on socket. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Set LINK_FLAGS for echo_srvAndreas Schneider2018-11-071-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Disable failing tests as on FreeBSDAndreas Schneider2018-11-061-0/+12
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Don't use string PREPENDAndreas Schneider2018-10-301-2/+2
| | | | | | | This is only supported in cmake >= 3.10. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* cmake: Update AddCMockaTestAndreas Schneider2018-10-231-42/+41
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Support running the tests with AddressSanitizerAndreas Schneider2018-10-231-1/+27
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Improve checks for compiler flagsAndreas Schneider2018-10-231-0/+14
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Suppress helgrind race condition warning we created on purposeAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Create an error if helgrind finds a bugAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Write helgrind logs to stderr so we can see themAndreas Schneider2018-10-231-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@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-021-1/+2
| | | | | | 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-021-1/+5
| | | | | | 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-021-1/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Remove extra test by moving getsockname() to anotherAnoop C S2018-03-261-1/+0
| | | | | | | | | | | | | | 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-041-1/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add a simple fnctl() testAndreas Schneider2017-09-071-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Avoid mutex lock wait in socket close failureAnoop C S2017-02-101-1/+2
| | | | | | | | | | | | | | | 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>
* 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-201-1/+2
| | | | | 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-231-0/+1
| | | | | | 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 for ephemeral port binding in listen()Andreas Schneider2015-11-041-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Add a unit test for wrap_sendmsg_filter_cmsghdr()Ralph Boehme2015-10-141-1/+2
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests: Add tcp sendmsg/recvmsg testAndreas Schneider2015-08-111-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix type punning warnings.Andreas Schneider2014-09-011-0/+1
| | | | | 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>
* tests: Add tests for bind().Andreas Schneider2014-05-311-0/+1
| | | | | 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-311-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add support to receive IP_PKTINFO in echo_srv.Andreas Schneider2014-05-221-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add test to verify that the binded iface address is correct.Andreas Schneider2014-05-081-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* cmake: Use SOCKET_WRAPPER_LOCATION.Andreas Schneider2014-02-041-2/+2
|
* cmake: Only build test_sendmsg_recvmsg_fd if we have msg_control.Andreas Schneider2014-01-211-2/+5
|
* tests: Add sendmsg_recvmsg_fd test.Jakub Hrozek2014-01-201-1/+2
|
* tests: Add test_echo_udp_sendmsg_recvmsg.Andreas Schneider2014-01-201-1/+2
|
* tests: Add test_echo_tcp_socket_options().Andreas Schneider2013-12-231-0/+1
|
* tests: Add test_echo_tcp_connect test.Andreas Schneider2013-12-231-1/+7
| | | | This tests some corner cases we fixed in the past.
* tests: Add test_echo_tcp_write_readvJakub Hrozek2013-12-201-1/+1
|
* tests: Add test_echo_tcp_write_read.Andreas Schneider2013-12-171-1/+1
|
* tests: Add test_echo_udp_send_recv test.Andreas Schneider2013-12-131-1/+1
|
* tests: Rename testsuite to test_ioctl.Andreas Schneider2013-12-121-1/+1
|
* cmake: Fix linking echo_srv on Solaris.Andreas Schneider2013-12-121-0/+1
|
* tests: Add a torture library with helpers.Andreas Schneider2013-12-101-2/+10
|
* tests: Add test_echo_udp_sendto_recvfrom.Andreas Schneider2013-12-101-13/+18
|
* cmake: Remove swrap env variables.Andreas Schneider2013-12-101-12/+0
| | | | They should be set up in the test!
* tests: Add a simple echo serverJakub Hrozek2013-12-101-0/+2
|