History log of /freebsd-10.1-release/tools/regression/sockets/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


261857 13-Feb-2014 asomers

MFC r261081, r261133, and r261615

r261081
Replace the old unix_seqpacket and unix_seqpacket_exercise
tests, which were a little broken and not automatable, with
unix_seqpacket_test. It's coverage is a superset of the old
tests and it uses ATF. It includes test cases for bugs
kern/185813 and kern/185812.

r261133
Fix the Makefiles so that the tests I submitted in r261081 will
actually get built.

r261615
tests/sys/Makefile
use TESTS_SUBDIRS for kern instead of SUBDIRS. I don't
think it makes a difference in this case, but
TESTS_SUBDIRS is generally correct for subdirectories
that contain tests.


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255451 10-Sep-2013 emaste

Add a sendfile regression test for transmit length > file size.

This test identified the issue fixed in FreeBSD-SA-13:11.sendfile.

Sponsored by: The FreeBSD Foundation
Approved by: re (glebius)


246670 11-Feb-2013 pluknet

Major update for unix_cmsg from Andrey Simonenko.

Quoting the submitter:
- Added tests for SCM_BINTIME, LOCAL_PEERCRED, cmsghdr.cmsg_len
- Code that checks correctness of groups was corrected (getgroups(2) change)
- unix_cmsg.c was completely redesigned and simplified
- Use less timeout value in unix_cmsg.c for faster work
- Added support for not sending data in a message, not sending data and
data array associated with a cmsghdr structure in a message
- Existent tests were improved
- unix_cmsg.t was redesigned and simplified

Correctness of unix_cmsg verified on 7.1-STABLE, 9.1-STABLE and 10-CURRENT.

PR: bin/131567
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
MFC after: 2 weeks


243314 19-Nov-2012 emaste

Zero the whole struct not just the size of a pointer.

Found by: clang


243313 19-Nov-2012 emaste

Use '%zd' format specifier for ssize_t

Found by: clang


243312 19-Nov-2012 emaste

Use '%zd' printf format for ssize_t.


241844 22-Oct-2012 eadler

remove duplicate semicolons where possible.

Approved by: cperciva
MFC after: 1 week


231855 17-Feb-2012 bz

Add regression tests for the setsockopt(2) SO_SETFIB socket option.

Check that the expected domain(9) families all handle the socket option
correctly and do proper bounds checks. This would catch bugs as fixed
in (r230938,)r230981.

Sponsored by: Cisco Systems, Inc.


228371 09-Dec-2011 jhb

- Add a test for PR 151758.
- While here, make this compile and work on non-i386:
- Use CMSG_SPACE(), CMSG_LEN(), and CMSG_FIRSTHDR() instead of ignoring
padding between 'struct cmsghdr' and control message payloads.
- Don't initialize the control message before calling recvmsg().
Instead, check that we get a valid control message on return from
recvmsg().
- Use errx() instead of err() for some errors that don't report failures
that set errno.

Requested by: kib (1)


216379 11-Dec-2010 pjd

Allow to specify path to a file we want to test with sendfile(2).
This allows to specify selected file system and not only /tmp/.


216151 03-Dec-2010 kib

Extend the unix gc regression test to cover the case of r216150.

Requested and reviewed by: rwatson
MFC after: 1 week


208602 27-May-2010 rwatson

Correct several nits/problems in the unix_close_race regression test.

Submitted by: Mikolaj Golub <to.my.trociny at gmail.com>
MFC after: 3 days


208562 26-May-2010 rwatson

Add unix_close_race, a regresion test to catch ENOTCONN being returned
improperly from one of two instances of close(2) being called
simultaneously on both ends of a connected UNIX domain socket. The test
tool is slightly tweaked to improve failure modes, and while often does
trigger the problem, doesn't do so consistently due to the nature of the
race.

PR: kern/144061
Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days


204585 02-Mar-2010 uqs

Always assign WARNS using ?=

- fix some nearby style bugs
- include Makefile.inc where it makes sense and reduces duplication

Approved by: ed (co-mentor)


204311 25-Feb-2010 ru

Fixed missing or broken library dependencies.


204294 24-Feb-2010 brucec

Update the sendfile regression test so that it outputs results in the
TAP format.
Add a checksum to verify that the data hasn't been corrupted between
being read from disk and being received.

Approved by: rrs (mentor)


197781 05-Oct-2009 rwatson

A few regression tests for SOCK_SEQPACKET UNIX domain sockets.

Sponsored by: Google


197432 23-Sep-2009 jhb

- Remove a bogus test: setsockopt() doesn't return a length, getsockopt()
does.
- Use %z to printf a size_t to fix compile on 64-bit platforms.


189543 08-Mar-2009 rwatson

In UNIX domain socket GC regression test, after setting a socket
non-blocking, EINPROGRESS is an acceptable result from connect().


183652 06-Oct-2008 rwatson

Add very simple regression test for fstat(2) on sockets: make sure it
returns success for various socket types. It's easy to imagine this
being enhanced to validate the returned data, but...


182903 10-Sep-2008 maxim

o Correct a comment: a test file size is a four pages not three.


175821 30-Jan-2008 rwatson

Add unix_sorflush, a regression test for the following scenario:

- Process (a) is blocked in read on a socket waiting on data.
- Process (b) is blocked in shutdown() on a socket waiting on (a).
- Process (c) delivers a signal to (b) interrupting its wait.

When the signal is delivered, the kernel panics as sblock() fails in
sorflush(). Even if it didn't panic, shutdown() would block potentially
indefinitely waiting for recv() to succeeded. Fixes to follow.

Reported by: Jos Backus <jos at catnook dot com>


175015 31-Dec-2007 rwatson

Add regression tests for UNIX domain socket garbage collection. Should be
run from single-user mode, as they look at global open file and inflight
descriptor counts to check for leaks.


169311 06-May-2007 rwatson

Add a regression test to detect if waiting on the I/O serialization lock
on socket buffers is interruptible or not, which detacts the regression I
introduced recently in 7-CURRENT (spotted by alfred). This test passes
in older -CURRENT, and with the as-yet uncommitted sx_xlock_sig and
sblock fix patches.


168912 20-Apr-2007 pjd

Test sending 0 bytes.


168911 20-Apr-2007 pjd

Fix length calculation.


168855 19-Apr-2007 des

Valid error codes for err() and errx() are 1..255.
The correct format specifier for ssize_t is %zd.


168854 19-Apr-2007 pjd

Add more tests to verify last sendfile(2) breakage: test sending more
than a page size and nbytes=0.


168278 02-Apr-2007 jhb

Fix a fd leak in socketpair():
- Close the new file objects created during socketpair() if the copyout of
the new file descriptors fails.
- Add a test to the socketpair regression test for this edge case.


168273 02-Apr-2007 jhb

Add another fd leak test for accept() I used to test the fix in 1.234 of
sys/kern/uipc_syscall.c.


165984 12-Jan-2007 rwatson

Ignore EINPROGRESS error on TCP connect(), and pick up the result of the
non-blocking connect later using select(). This case didn't trigger on
my UP test box, but did on Peter's SMP test box.

Spotted by: peter


165982 12-Jan-2007 rwatson

Add a regression test for sending and writing zero bytes to sockets of
various types, as well as pipes and fifos for good measure. RELENG_6
currently passes all of these tests, but 7-CURRENT fails 0-byte writes
and sends on all stream socket types (and fifos, as they are based on
stream sockets).

Bumped into by: peter
Diagnosed by: jhb
Problem of: andre


165503 23-Dec-2006 bms

Drop all received data mbufs from a socket's queue if the MT_SONAME
mbuf is dropped, to preserve the invariant in the PR_ADDR case.

Add a regression test to detect this condition, but do not hook it
up to the build for now.

PR: kern/38495
Submitted by: James Juran
Reviewed by: sam, rwatson
Obtained from: NetBSD
MFC after: 2 weeks


164298 15-Nov-2006 rwatson

Add a short regression test to try to exercise races in the non-atomic
nature of implied connect via sendto(). Oddly, uipc_usrreq.c implements
this for stream sockets, but doesn't set the flag in its protocol
definition so that it can actually be used. As such, the stream test is
implemented but doesn't run for now.


160202 09-Jul-2006 maxim

o style.Makefile(5): WARNS= -> WARNS?=.


159095 31-May-2006 maxim

o Let getopt(3) report errors in command line arguments.
o If something is wrong with options, then output short usage help message.
o Output errstr returned from strtonum(3).

PR: bin/98141
Submitted by: Andrey Simonenko


159045 29-May-2006 maxim

o Add a collection of regression tests for ancillary (control)
data passing for unix domain sockets, stream and datagram.

There are 15 tests:

Test/Type of socket STREAM DGRAM
----------------------------------------------------------------------
Sending, receiving cmsgcred 1 6
Receiving sockcred (listening socket has LOCAL_CREDS) 2 n/a
Receiving sockcred (accepted socket has LOCAL_CREDS) 3 n/a
Receiving sockcred n/a 7
Sending cmsgcred, receiving sockcred 4 8
Sending, receiving timestamp 5 9
Sending, receiving cmsgcred (no control data) 10 13
Sending cmsgcred, receiving sockcred (no control data) 11 14
Sending, receiving timestamp (no control data) 12 15

Currently we pass 8 tests. All the rest marked as TODO.

PR: kern/90800
Submitted by: Andrey Simonenko


158911 25-May-2006 rwatson

Use WARNS and rely on rules rather than an explicit target for the
test binary.

Reported by: maxim


158910 25-May-2006 rwatson

Add a basic regression test for sendfile() over TCP, which sends varying
lengths of headers and data and makes sure it receives about the right
number of bytes.


157603 09-Apr-2006 rwatson

Add a simple regression test that creates and tears down route sockets,
and confirms that only SOCK_RAW works with socket(), and nothing works
with socketpair().


157602 09-Apr-2006 rwatson

Add simple regression tests that creates UNIX domain sockets using
socket() and socketpair() of SOCK_STREAM and SOCK_DGRAM types. It
also confirms that SOCK_RAW fails.


156735 15-Mar-2006 ru

Style: NO_MAN doesn't need any value.


152251 09-Nov-2005 rwatson

Add unix_passfd, a simple set of regression tests for UNIX domain socket
file descriptor passing. These tests are not all currently passed.


150286 18-Sep-2005 rwatson

Add a regression test for listen()'s backlog argument, both at time of
creation and at time of update using an additional call to listen().
This test also exercises SO_LISTENQLIMIT, a forthcoming socket option
that allows the retrieval (but not setting) of the queue limit.

Discussed with: andre


150156 15-Sep-2005 maxim

Remove checks for shutdown(2) on non-connected socket.


150043 12-Sep-2005 maxim

o Add shutdown(2) regression tests. At the moment we cannot pass
shutdown-on-non connected socket test, kern/84761.


147300 11-Jun-2005 maxim

o setsockopt(2) cannot remove accept filter. [1]
o getsockopt(SO_ACCEPTFILTER) always returns success on listen socket
even we didn't install accept filter on the socket.
o Fix these bugs and add regression tests for them.

Submitted by: Igor Sysoev [1]
Reviewed by: alfred
MFC after: 2 weeks


146250 16-May-2005 rwatson

Close the connect socket as well as the listen socket on completion.

Update copyright.


143413 11-Mar-2005 rwatson

Check the return value of shutdown().


143409 11-Mar-2005 rwatson

Add sigpipe, a simple UNIX domain socket and TCP regression test that is
intended to verify that SIGPIPE is delivered to a process writing or
sending on a socket that has been shut down for write. If available,
SO_NOSIGPIPE is also tested.

This regression test is currently passed by RELENG_4, but not by HEAD or
RELENG_5, due to a bug in the write() code for sockets. SO_NOSIGPIPE is not
present in RELENG_4, however, so is not tested there.

Reported by: Mikko Tyolajarvi <mbsd at pacbell dot net>
PR: 78478


142146 20-Feb-2005 rwatson

Add a simple regression test for stream UNIX domain sockets and the
bind()/connect() system calls, which is intended to confirm that the
right successes and errors occur when rendezvousing via the file system
name space.


140643 22-Jan-2005 rwatson

Use WARNS?= instead of WARNS= in Makefiles so that global warning
settings can override local ones.

Pointed out by: ru


140109 12-Jan-2005 sobomax

Add test which excersises problem with unability to change association of
already associated datagram unix domain socket by issuing connect() system
call.


139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


137587 11-Nov-2004 nik

Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.

Update README to describe the new protocol. The work's broken down into
two main sets of changes.

First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.

Second, provide the .t files that actually run the tests. In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.

Add a TODO file.


137130 02-Nov-2004 rwatson

Add a small regression test that opens a TCP socket, listens on it,
performs a non-blocking connect from another socket, and then closes
the listen socket rather than accepting. This is intended to
exercise the close path in which connections are aborted due to a
close on the listen socket while the connection is in the listen
queue.


136910 24-Oct-2004 ru

For variables that are only checked with defined(), don't provide
any fake value.


136844 23-Oct-2004 rwatson

Use errx() instead of fprintf()/exit() for conciseness.

Suggested by: ru (some time ago)


136843 23-Oct-2004 rwatson

Use errx() instead of perror()/exit() for conciseness.

Suggested by: ru (some time ago)


135425 18-Sep-2004 rwatson

Modify accept_fd_leak regression test to generate "PASS" output, not
just "FAIL" output, in order to make it consistent with other tests in
the regression test tree.


134681 03-Sep-2004 ru

Join the effort in simplifying this makefile. ;)


134662 02-Sep-2004 rwatson

Pass O_NONBLOCK directly to fcntl() rather than the pointer to an int
holding the value O_NONBLOCK. This worked previously because I was
lucky.


134661 02-Sep-2004 rwatson

Don't override the rule used to build a binary by providing our own
compiler line.


134238 24-Aug-2004 rwatson

Make sure to properly initialize 'size' to sizeof(sin) before passing
it into accept(). Depending on the initial value in memory, it is
otherwise possible to get EINVAL.


134236 24-Aug-2004 rwatson

Add a basic kqueue + UNIX domain socket pair regression test to do some
elementary exercising of kqueues on datagram and stream sockets. Note
that the datagram write kqueue case is left untested due to potentially
confusing behavior for the developer (me) that might require attention.


133105 04-Aug-2004 rwatson

Add minimal socketpair() regression test to confirm that we can create
(and close) PF_UNIX socket pairs, and that we can't create PF_INET
socket pairs. More tests to follow.


132649 26-Jul-2004 rwatson

Simple attachment regression test to attach the "accf_data" accept
filter to an inet socket and check at various points during the socket
life cycle that the filter can or cannot be attached, and that once
attached that the right one is attached and that it can be queried.


132295 17-Jul-2004 rwatson

Add simple regression test to detect leakage of file descriptors when
accept() returns EAGAIN on a non-blocking listen socket. This is the
tool I used to check that such a bug was resolved when merging accept()
locking.