summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* socket_wrapper.c/tests: fall back to pragma init/fini for ↵Björn Jacke2020-11-041-1/+4
| | | | | | constructor/destructor if possible Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* test_echo_tcp_socket_options.c: add tests for TCP_INFOStefan Metzmacher2020-06-222-0/+82
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit a37c0175492fb1b35257b785c71dea4e4f6d4750)
* Revert "test_echo_tcp_socket_options.c: add tests for TCP_INFO"Stefan Metzmacher2020-06-192-82/+0
| | | | | | | | This reverts commit a37c0175492fb1b35257b785c71dea4e4f6d4750. This got merged automatically by gitlab without review. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* test_echo_tcp_socket_options.c: add tests for TCP_INFOStefan Metzmacher2020-06-192-0/+82
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* tests: do not truncate pid to 16 bitsMike Gilbert2020-05-141-6/+4
| | | | | | | | | | On Linux, pid_t is a 32-bit type, and the kernel permits pids up to 22 bits in length. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14373 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Fix a compile warning on UbuntuAndreas Schneider2020-03-241-1/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix a coverty warning in echo_srvAndreas Schneider2020-03-231-1/+3
| | | | | | CID #288875 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix typo in echo_srv helpAndreas Schneider2019-03-211-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@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>
* tests: Increase backlog count for listen() in echo_srvAnoop C S2018-11-121-1/+1
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Protect IPv6 in st_echo_tcp_get_peer_sock_nameAndreas Schneider2018-11-071-0/+15
| | | | | Signed-off-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>
* tests: Protect IPv6 function in setup_echo_srv_tcp_ipv6Andreas Schneider2018-11-061-0/+2
| | | | | | | Fixes the build on OmniOS. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Protect IPv6 case in echo_srvAndreas Schneider2018-11-061-0/+6
| | | | | | | This fixes the build on OmniOS. 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>
* tests: Init in_addr only once in test_tcp_socket_overwriteAndreas Schneider2018-10-231-7/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Return an error if setenv() fails in test_max_socketsAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check the correct return code in test_thread_echo_tcp_write_readAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check return code of connect in test_thread_echo_tcp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check the return code of connect in test_echo_udp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check return code of connnect in test_echo_tcp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Check for a valid pidfile pointerAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Only use 128K as buffer size instead of 4MBAndreas Schneider2018-10-231-1/+1
| | | | | | | This produced errors built with clang. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture: Wait longer for echo_srv startupAndreas Schneider2018-10-231-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Do not close bogus file descriptorsAndreas Schneider2018-10-231-4/+2
| | | | | | | | | | | | | | ==1564== Warning: invalid file descriptor 1048564 in syscall close() ==1564== at 0x4D18534: close (in /lib64/libc-2.27.so) ==1564== by 0x4046A74: libc_close (socket_wrapper.c:760) ==1564== by 0x405105C: swrap_close (socket_wrapper.c:5933) ==1564== by 0x40511F5: close (socket_wrapper.c:5979) ==1564== by 0x401679: become_daemon (echo_srv.c:202) ==1564== by 0x402D44: main (echo_srv.c:896) ==1563== Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Use assert_return_code() to get errnoAndreas Schneider2018-10-231-8/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Avoid -Wcast-align warningAnoop C S2018-10-231-28/+18
| | | | | | | | | | | | | | | warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Wcast-align] struct sockaddr_in *sinp = (struct sockaddr_in *)to; ^~~~~~~~~~~~~~~~~~~~~~~~ Above warning can be avoided by making use of sockaddr_in available within torture_address from the caller of echo_udp_recv_from_to(). Following that sa_socklen from torture_address can be used instead of passing sa_socklen explicitly to echo_udp_recv_from_to(). Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Fix -Wformat gcc warningAnoop C S2018-10-231-1/+1
| | | | | | | | | test_fork_thread_deadlock.c:48:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘pid_t {aka long int}’ [-Wformat=] Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@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-232-1/+12
| | | | | 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>
* tests: Update valgrind suppression fileAndreas Schneider2018-08-171-1/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* 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>