summaryrefslogtreecommitdiff
path: root/tools/regression/sockets
Commit message (Collapse)AuthorAgeFilesLines
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-0123-23/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* Make timespecadd(3) and friends publicAlan Somers2018-07-302-49/+10
| | | | | | | | | | | | | | | | | | | | | | The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725 Notes: svn path=/head/; revision=336914
* Fix the build of tools/regression/sockets/unix_cmsgAlan Somers2018-07-191-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=336466
* Convert tools/regression/sockets/socketpair to ATFAlan Somers2018-02-102-170/+0
| | | | | | | | | Reviewed by: cem MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14305 Notes: svn path=/head/; revision=329108
* Add a test case for a connection on accept queue that is reset beforeGleb Smirnoff2017-08-241-8/+35
| | | | | | | | it is accepted. In that case accept(2) shall return ECONNABORTED. Accept filters provide help with easily replicating that case. Notes: svn path=/head/; revision=322858
* Make the test to leave one connection on the incomplete queueGleb Smirnoff2017-06-081-0/+14
| | | | | | | before exiting. This examines some race conditions in kernel. Notes: svn path=/head/; revision=319684
* Improve this unit test: make sure that the accept filter actually works.Gleb Smirnoff2017-06-081-7/+38
| | | | | | | | | | Before this test just checked scenario of setting and removing the accept filter at different states of the socket. Now it also checks that accept filter works: we connect to the server, and then check that we can't accept, then we send 1 byte of data and check again. Notes: svn path=/head/; revision=319683
* Add a regression test for putting a socket on kqueue, and then doingGleb Smirnoff2017-02-142-0/+121
| | | | | | | listen(2) on it (see r313043). Based on Hartmut's code. Notes: svn path=/head/; revision=313750
* Add a new socket option SO_TS_CLOCK to pick from several different clockMaxim Sobolev2017-01-164-1/+691
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sources to return timestamps when SO_TIMESTAMP is enabled. Two additional clock sources are: o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC). In addition to this, this option provides unified interface to get bintime (equivalent of using SO_BINTIME), except it also supported with IPv6 where SO_BINTIME has never been supported. The long term plan is to depreciate SO_BINTIME and move everything to using SO_TS_CLOCK. Idea for this enhancement has been briefly discussed on the Net session during dev summit in Ottawa last June and the general input was positive. This change is believed to benefit network benchmarks/profiling as well as other scenarios where precise time of arrival measurement is necessary. There are two regression test cases as part of this commit: one extends unix domain test code (unix_cmsg) to test new SCM_XXX types and another one implementis totally new test case which exchanges UDP packets between two processes using both conventional methods (i.e. calling clock_gettime(2) before recv(2) and after send(2)), as well as using setsockopt()+recv() in receive path. The resulting delays are checked for sanity for all supported clock types. Reviewed by: adrian, gnn Differential Revision: https://reviews.freebsd.org/D9171 Notes: svn path=/head/; revision=312296
* Check that SCM_XXX timestamp returned by the kernel is less 1 secondMaxim Sobolev2016-12-094-1/+143
| | | | | | | | | away in the past from the current time. This should be plenty for the scheduler to do its job. It provides assurance that the timestamp returned is actually a valid one, not just some random garbage. Notes: svn path=/head/; revision=309773
* Auto-generate 2 test cases that differ only in structure and SCM_XXX constantMaxim Sobolev2016-12-065-205/+45
| | | | | | | | | used. We can do it programmatically, but that would make code convoluted and more complex. I have two more of those types coming for the CLOCK_REALTIME and CLOCK_MONOTONIC. This seems like an elegant and scallable approach. Notes: svn path=/head/; revision=309631
* Refactor the regression test code by splitting huge monolithic CMaxim Sobolev2016-12-0520-1643/+2300
| | | | | | | | | | | file into smaller pieces that are hopefully easier to understand and extend. This is to pave the ground for adding few more socket timestamp formats that I am working on here. No functional changes (I hope). Notes: svn path=/head/; revision=309554
* tools: minor spelling fixes.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | | | Mostly comments but also some user-visible strings. MFC after: 2 weeks Notes: svn path=/head/; revision=298881
* Use different ports in the TCP/UDP testcases with the first set andEnji Cooper2016-01-231-10/+10
| | | | | | | | | | | | | | | | | the second set (increment the original ports by 10) This avoids issues where the first listening socket might not be torn down by the time it makes it to the second set of testcases. The sockets should likely only be setup once, but this keeps in the spirit of the original testcases, so this will be easier to backport to ^/stable/9 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294647
* Don't run the t_cmsg_len testcase on 64-bit architecturesEnji Cooper2016-01-231-0/+12
| | | | | | | | | | | | | | It always fails when trying to send through the sendit(9) private KPI in the kernel due to a size mismatch between the msghdr and data being sent [*], which suspiciously seems like it's related to sizeof pointers instead of scalars, or something of that ilk MFC after: 1 week PR: 206543, 206544 [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294646
* - Don't return immediately in check_xucred, check_scm_creds_cmsgcred, andEnji Cooper2016-01-231-81/+98
| | | | | | | | | | | | | | | | | check_scm_creds_sockcred after initial != NULL checks have been done for debugging purposes - Use more terse names for bintime (bt), cmesgcred (cmcred), sockcred (sc), and timeval (tv) [*] - Add some debug messages to better understand some of the flow of the test program MFC after: 1 week Requested by: bde [*] Use of the word "terse" (^.^) corrected by: jhb, rpokala [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294645
* Fix -Wunused warning with clang/gccEnji Cooper2016-01-162-2/+2
| | | | | | | | | | | - Get rid of unused argc/argv variables in main - Bump WARNS to 6 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294128
* Fix warnings with clang/gccEnji Cooper2016-01-162-33/+33
| | | | | | | | | | | | | - Get rid of unused argc/argv variables in main - Exit on failure with a return code of 1 instead of -1 with err/errx as a return code of -1 is implementation dependent - Bump WARNS to 6 MFC after: 5 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294127
* Fix warnings with gcc 5.0Enji Cooper2016-01-162-4/+2
| | | | | | | | | | | | | | | | | reconnect.c: - Convert the K&R prototype of main to an ANSI prototype to mute a warning from gcc 4.2.1 - Close s_sock2 after finishing off the last test to plug a leak and mute a warning from gcc 5.0 about a -Wunused-but-set variable sendfile.c: - Fix a -Wunused-but-set warning with gcc 5.0 with pagesize in main(..) MFC after: 5 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294126
* Test for EPROTOTYPE not EPROTONOSUPPORTEnji Cooper2016-01-162-5/+5
| | | | | | | | | | | | | - `SOCK_RAW` is the implied supported type parameter for socket(2) per route(4) - localsw in `sys/kern/uipc_usrreq.c` doesn't have an entry for `SOCK_RAW`, so the prototype is invalid (this isn't explicitly documented anywhere I could find) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294125
* Add missing newline to message about requiring root privilegesEnji Cooper2016-01-161-1/+1
| | | | | | | | | | | This will help ensure that scripts/parsers don't get confused when the message is printed out MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=294123
* - Check for accf_filter before running the tests, otherwise it will alwaysEnji Cooper2016-01-151-2/+13
| | | | | | | | fail at subtest 9/11 - Use strncpy instead of strcpy with afa.af_name Notes: svn path=/head/; revision=294103
* Integrate tools/regression/sockets/unix_passfd into the FreeBSD testEnji Cooper2015-12-302-397/+0
| | | | | | | | | | | | | | | | | | suite as tests/sys/kern/unix_passfd_test - Convert testcases to ATF - Fix an alignment issues - Mark rights_creds_payload(..) as an expected failure (see PR # 181741) Based [in part] on the following Differential Revision: https://reviews.freebsd.org/D689 MFC after: 1 week Submitted by: markj Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=292914
* - Explicitly initialize ch to 0Enji Cooper2015-12-281-5/+6
| | | | | | | | | | | | | | | - Delete some spurious whitespace - Use calloc instead of malloc in the last test to ensure that sendspace is properly zero'ed out Differential Revision: https://reviews.freebsd.org/D689 (part of a larger diff) MFC after: 1 week Reviewed by: asomers, ngie Submitted by: markj Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=292814
* Fix LDADD/DPADD that should be LIBADD.Bryan Drewery2015-12-041-2/+1
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291738
* Fix even more warnings..Enji Cooper2015-04-112-3/+4
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281411
* Fix more warnings I didn't catch in the first go-aroundEnji Cooper2015-04-112-6/+3
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281410
* Fix warnings, bump WARNS to 6, and use a temporary socket instead of one in /tmpEnji Cooper2015-04-112-8/+8
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281409
* - Remove the .t wrapper and put the "magic" of determining the number ofEnji Cooper2015-04-112-59/+11
| | | | | | | | | | | | testcases into the .c file - Require root for now because it fails with SOCK_RAW without root privileges - Increment the test count properly on socket create failure MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281408
* Fix the knob twiddling to work properly per src.opts.mkEnji Cooper2015-04-111-4/+6
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281407
* Generate temporary files with mkstemp instead of mktempEnji Cooper2015-04-111-3/+3
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281404
* Garbage collect argc/argv and bump WARNS to 6Enji Cooper2015-04-112-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281403
* Garbage collect argc/argv and bump WARNS to 6Enji Cooper2015-04-112-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281402
* - Garbage collect argc/argvEnji Cooper2015-04-112-11/+14
| | | | | | | | | | - Use random paths instead of one in /tmp MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281401
* - Garbage collect argc/argv; bump WARNS to 6Enji Cooper2015-04-112-6/+11
| | | | | | | | | | | - Make the socket path random and move it out of /tmp as that's outside ATF's prescribed path MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281400
* Fix warnings and bump WARNS to 6Enji Cooper2015-04-112-6/+6
| | | | | | | | | | | | - Staticize variables as needed - Garbage collect argc/argv - Fix -Wsign-compare warnings by casting small sizeof to (int) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281399
* Garbage collect argc/argv and bump WARNS to 6Enji Cooper2015-04-112-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281398
* Mark signum unused in signal_handler; bump WARNS to 6Enji Cooper2015-04-112-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281397
* Fix a -Wuninitialized warning by setting the socket to -1 and bump WARNS to 6Enji Cooper2015-04-112-1/+3
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281395
* - Don't use /tmp because it's outside ATF's prescribed sandboxEnji Cooper2015-04-111-4/+4
| | | | | | | | | | | - Replace a hardcoded PATH_MAX value with sizeof(path) - Use path like an array, not a pointer, and always try to unlink it in cleanup MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281394
* Fix warnings and bump WARNS to 6Enji Cooper2015-04-112-7/+7
| | | | | | | | | | | | - Garbage collect argc/argv (-Wunused) - sleep(3) will always return an unsigned int; don't check for return codes <0 (-Wsign-compare) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281393
* - Garbage collect argc/argv (-Wunused)Enji Cooper2015-04-112-2/+2
| | | | | | | | | | - Bump WARNS to 6 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281392
* - Use static buffers for temporary file paths instead of strdup of constant ↵Enji Cooper2015-04-111-14/+8
| | | | | | | | | | | | | strings - Don't use /tmp because it's outside ATF's prescribed sandbox - Use mkstemp instead of mktemp to eliminate warning MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281391
* Use _exit, not exit in forked processEnji Cooper2015-04-101-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281362
* Remove argc/argv (-Wunused)Enji Cooper2015-04-102-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281361
* Fix warningsEnji Cooper2015-04-102-3/+4
| | | | | | | | | | | - Remove argc/argv (-Wunused) - Mark some parameters to socket_listen_update __unused (-Wunused) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281360
* Remove argc/argv (-Wunused)Enji Cooper2015-04-102-2/+2
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281359
* - Parameterize out the number of accept/connect attemptsEnji Cooper2015-04-102-19/+35
| | | | | | | | | | | | | | | | | - Randomize the bind port to allow 2+ consecutive calls in < 10 minutes, and to also not fail if (for instance) there's a server already listening on port 8080 - Don't leak the listening socket / fds into the child process - Fix warnings: -- Remove argc/argv (-Wunused) -- Mark sig __unused (-Wunused) -- Mark quit static (-Wmissing-variable-declarations) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281358
* Fix -Wunused warnings, bump WARNS to 6Enji Cooper2015-04-102-2/+3
| | | | | | | | | | | | The output is still broken if prove -rv is run and the testcase aborts prematurely with fail_assertion (the testcase doesn't really conform to TAP protocol properly, except when it completes fully) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281356
* Fix -Wunused warnings, bump WARNS to 6Enji Cooper2015-04-102-4/+2
| | | | | | | | | | | | | | The testcase fails today on subtest # 9 The output is still broken if prove -rv is run and the testcase aborts prematurely (the testcase doesn't really conform to TAP protocol properly, except when it completes fully) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=281355