342704 |
02-Jan-2019 |
jhb |
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.
Once a signal's siginfo was copied to 'td_si' as part of the signal exchange in issignal(), it was never cleared. This caused future thread events that are reported as SIGTRAP events without signal information to report the stale siginfo in 'td_si'. For example, if a debugger created a new process and used SIGSTOP to stop it after PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI with the SIGSTOP siginfo in pl_siginfo. This broke 'catch syscall' in current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP indicates a breakpoint or single step trap. |
339068 |
01-Oct-2018 |
asomers |
MFC r337222:
Fix LOCAL_PEERCRED with socketpair(2)
Enable the LOCAL_PEERCRED socket option for unix domain stream sockets created with socketpair(2). Previously, it only worked with unix domain stream sockets created with socket(2)/listen(2)/connect(2)/accept(2).
PR: 176419 Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk> Differential Revision: https://reviews.freebsd.org/D16350 |
328384 |
25-Jan-2018 |
jhb |
MFC 287600,287602: Fixes for fork following tests.
287600: Properly size the children[] arrays in the follow fork tests.
287602: Use _exit() instead of exit() in child processes created during tests. |
328379 |
24-Jan-2018 |
jhb |
MFC 325028,328344: Discard the correct thread event reported for a ptrace stop.
325028: Discard the correct thread event reported for a ptrace stop.
When multiple threads wish to report a tracing event to a debugger, both threads call ptracestop() and one thread will win the race to be the reporting thread (p->p_xthread). The debugger uses PT_LWPINFO with the process ID to determine which thread / LWP is reporting an event and the details of that event. This event is cleared as a side effect of the subsequent ptrace event that resumed the process (PT_CONTINUE, PT_STEP, etc.). However, ptrace() was clearing the event identified by the LWP ID passed to the resume request even if that wasn't the 'p_xthread'. This could result in clearing an event that had not yet been observed by the debugger and leaving the existing event for 'p_thread' pending so that it was reported a second time.
Specifically, if the debugger stopped due to a software breakpoint in one thread, but then switched to another thread that was used to resume (e.g. if the user switched to a different thread and issued a step), the resume request (PT_STEP) cleared a pending event (if any) for the thread being stepped. However, the process immediately stopped and the first thread reported it's breakpoint event a second time. The debugger decremented the PC for "both" breakpoint events which resulted in the PC now pointing into the middle of an instruction (on x86) and a SIGILL fault when the process was resumed a second time.
To fix, always clear the pending event for 'p_xthread' when resuming a process. ptrace() still honors the requested LWP ID when enabling single-stepping (PT_STEP) or setting a different PC (PT_CONTINUE).
328344: Mark the unused argument to continue_thread() as such.
clang in HEAD and 11 does not warn about this, but clang in 10 does. |
328309 |
24-Jan-2018 |
jhb |
MFC 326953: Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies.
Some of the ptrace tests need to wait for a child process to become a zombie before preceding. The parent process polls the child process via the kern.proc.pid sysctl to wait for it to become a zombie. Previously the code polled until the sysctl failed with ESRCH. Now it will poll until either the sysctl fails with ESRCH (for compatiblity with older kernels) or returns a kinfo_proc structure with the ki_stat field set to SZOMB. |
324690 |
17-Oct-2017 |
ngie |
MFC r324478:
Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output
^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e., ensure that the exit code is either 0 or 7.
The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made the issue apparent -- thus this needs to be fixed independent of ^/head@r323923.
PR: 222780 MFC with: r323923 |
321644 |
28-Jul-2017 |
ngie |
MFC r320446:
trailing_slash is a TAP-compliant testcase; mark it as such, instead of calling is a plain testcase. |
321641 |
28-Jul-2017 |
ngie |
MFC r320445:
Don't hardcode path to file in /tmp; this violates the kyua sandbox |
319344 |
31-May-2017 |
asomers |
MFC r318593:
Fix build of AIO tests with -DDEBUG
Also, redefine some constants for clarity. No functional change. |
319301 |
31-May-2017 |
ngie |
MFC r319056,r319058,r319059,r319060,r319061,r319078:
r319056:
tests/sys/file/ftruncate_test: use an exit code of 1 instead of -1 with err*(3).
An exit code of -1 is implementation defined -- it's best to stick with something well-defined (1).
r319058:
Create a deterministic file in the kyua sandbox, instead of a temporary file outside the kyua sandbox
This helps ensure that the file is removed at test exit, and as a side effect, cures a warning about umasks with Coverity.
r319059:
Use an exit code of 1 instead of -1 for reasons noted in r319056
r319060:
Use main(void) instead of main(argc __unused, argv __unused)
r319061:
Don't leak accept_fd on thread completion
CID: 1296068
r319078:
Tweak r319058 slightly
- Specify an explicit mode when using O_CREAT per open(2). - Fix the error message (add missing enclosing parentheses).
MFC with: r319058 |
319007 |
27-May-2017 |
ngie |
MFC r318546:
sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
The previous logic was flawed in the sense that it assumed that /dev/md3 was always available. This was a caveat I noted in r306038, that I hadn't gotten around to solving before now.
Cache the device for the mountpoint after executing mdmfs, then use the cached value in basic_cleanup(..) when unmounting/disconnecting the md(4) device.
Apply sed expressions to use reuse logic in the NetBSD code that could also be applied to FreeBSD, just with different tools. |
317834 |
05-May-2017 |
brooks |
MFC r317566:
Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
These commands take an int. The tests work by accident on little-endian, 64-bit systems.
PR: 218919 Tested with: qemu-cheri and CheriBSD built for mips64 Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL |
317093 |
18-Apr-2017 |
asomers |
MFC r285117
Make cleanup routines idempotent
cleanup routines can be executed at any point during the execution of the body, including even before the body has done any real work. In those cases, cleanup routines should be careful to not raise spurious errors so as to not "override" the actual result of the test case.
This is just general good coding style but is not a problem in practice for these specific tests. (The way I discovered the issue, though, was due to a regression I introduced in Kyua itself while refactoring some internals.)
MFC after: 1 week |
315963 |
25-Mar-2017 |
badger |
MFC r315412, r314852:
r315412: Don't clear p_ptevents on normal SIGKILL delivery
The ptrace() user has the option of discarding the signal. In such a case, p_ptevents should not be modified. If the ptrace() user decides to send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events do not have the capability to discard the signal, so continue to clear the mask in that case.
r314852: don't stop in issignal() if P_SINGLE_EXIT is set
Suppose a traced process is stopped in ptracestop() due to receipt of a SIGSTOP signal, and is awaiting orders from the tracing process on how to handle the signal. Before sending any such orders, the tracing process exits. This should kill the traced process. But suppose a second thread handles the SIGKILL and proceeds to exit1(), calling thread_single(). The first thread will now awaken and will have a chance to check once more if it should go to sleep due to the SIGSTOP. It must not sleep after P_SINGLE_EXIT has been set; this would prevent the SIGKILL from taking effect, leaving a stopped orphan behind after the tracing process dies.
Also add new tests for this condition.
Sponsored by: Dell EMC |
315949 |
25-Mar-2017 |
badger |
MFC r313992, r314075, r314118, r315484:
r315484: ptrace_test: eliminate assumption about thread scheduling
A couple of the ptrace tests make assumptions about which thread in a multithreaded process will run after a halt. This makes the tests less portable across branches, and susceptible to future breakage. Instead, twiddle thread scheduling and priorities to match the tests' expectation.
r314118: Actually fix buildworlds other than i386/amd64/sparc64 after r313992
Disable offending test for platforms without a userspace visible breakpoint().
r314075: Fix world build for archs where __builtin_debugtrap() does not work.
The offending code was introduced in r313992.
r313992: Defer ptracestop() signals that cannot be delivered immediately
When a thread is stopped in ptracestop(), the ptrace(2) user may request a signal be delivered upon resumption of the thread. Heretofore, those signals were discarded unless ptracestop()'s caller was issignal(). Fix this by modifying ptracestop() to queue up signals requested by the ptrace user that will be delivered when possible. Take special care when the signal is SIGKILL (usually generated from a PT_KILL request); no new stop events should be triggered after a PT_KILL.
Add a number of tests for the new functionality. Several tests were authored by jhb.
PR: 212607 Sponsored by: Dell EMC |
314817 |
07-Mar-2017 |
ngie |
MFC r314450,r313439:
r314450:
Add additional __FreeBSD_version guards around the hsearch_r testcases
The reasoning for this is the same as r276046: to ease MFCing the tests to ^/stable/10 .
This was accidentally missed in r313439
r313439 | ngie | 2017-02-08 01:46:15 -0800 (Wed, 08 Feb 2017) | 25 lines
Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head
The primary end-goal of this drop is ease future merges with NetBSD and collaborate further with the NetBSD project.
The goal was (largely, not completely as some items are still oustanding in the NetBSD GNATS system) achieved by doing the following: - Pushing as many changes required to port contrib/netbsd-tests back to NetBSD as possible, then pull the upstream applied changes back in to FreeBSD. - Diff reduce with upstream where possible by: -- Improving libnetbsd header, etc compat glue. -- Using _SED variables to modify test scripts on the fly for items that could not be upstreamed to NetBSD.
As a bonus for this work, this change also introduces testcases for uniq(1).
Many thanks to Christos for working with me to get many of the changes back into the NetBSD project.
In collaboration with: Christos Zoulas <christos@netbsd.org> |
313791 |
16-Feb-2017 |
ngie |
MFC r295643:
r295643 (by bdrewery):
Test directories can build in parallel fine. |
313754 |
15-Feb-2017 |
asomers |
MFC r311893, r313008, r313081
I had to modify the tests slightly for the MFC to stable/10, because stable/10 lacks r294037, which enabled /sbin/md5 to work on md(4) devices.
r311893: ATFify the geom gate tests.
This ensures their cleanup routines will be run even if they should timeout.
tests/sys/geom/class/gate/ggate_test.sh tests/sys/geom/class/gate/Makefile Add an ATF test with three testcases, one for each TAP test. Use ATF-style cleanup functions, and convert sleeps to polling loops.
ObsoleteFiles.inc tests/sys/geom/class/gate/conf.sh tests/sys/geom/class/gate/1_test.sh tests/sys/geom/class/gate/2_test.sh tests/sys/geom/class/gate/3_test.sh Delete TAP test files
Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8891
r313008: Wait for /dev/ggate* to appear after calling `ggatel create` in :ggatel_{file,md}
The test assumed that `ggatel create` created a device on completion, but that's incorrect. This squashes the race by waiting for the device to appear, as `ggatel create` daemonizes before issuing an ioctl to geom_gate(4) if not called with `-v`.
Discussed with: asomers MFC after: 1 week PR: 204616 Sponsored by: Dell EMC Isilon
r313081: Replace for/retry loops with "wait_for_ggate_device" calls and check results of commands
As noted in r313008, the underlying issue was that geom_gate device creation wasn't created at ggatel command completion, but some short time after. ggatec(8) employs similar logic when creating geom_gate(4) devices.
Switch from retry loops (after the ggatec/dd write calls) to wait_for_ggate_device function calls after calling ggatec(8) instead to detect the presence of the /dev/ggate* device, as this function is sufficient for determining whether or not the character device is ready for testing
While here, use atf_check consistently with all dd calls to ensure that data output is as expected.
MFC after: 1 week Reviewed by: asomers Differential Revision: D9409 Sponsored by: Dell EMC Isilon |
313519 |
10-Feb-2017 |
ngie |
MFC r307702:
Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite as tests/sys/fs
These testcases exercise tmpfs support |
313508 |
10-Feb-2017 |
ngie |
MFC r305468:
Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...
proc2_test must be skipped because the invariant tested (`ke.fflags & NOTE_TRACKERR`) doesn't pass. |
313507 |
10-Feb-2017 |
ngie |
Remove EVFILT_PROCDESC block
This reapplies the patch that was done in ^/stable/10@r297977
This is a direct commit to ^/stable/10
Sponsored by: Dell EMC Isilon |
313505 |
10-Feb-2017 |
ngie |
MFC r304797,r305467:
r304797 (by jmmv):
Make use of Kyua's work directories.
Change the vnode tests to use the current directory when creating temporary files, which we can assume is a volatile work directory, and then make the kqueue_test.sh driver _not_ abandon the directory created by Kyua.
This makes the various kqueue tests independent of each other, and ensures the temporary file is cleaned up on failure.
Problem spotted by asomers@ when reviewing D4254.
r305467:
Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...
This is being done to clearly distinguish the libkqueue tests from the (soon to be imported) NetBSD tests. |
313488 |
09-Feb-2017 |
ngie |
MFC r289172,r290254:
r289172:
Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and netbsd-tests.test.mk (r289151)
- Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity
r290254:
Remove unused variable (SRCDIR) |
313303 |
05-Feb-2017 |
jilles |
MFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work. |
313219 |
04-Feb-2017 |
ngie |
MFC r312164:
Fix -Wformat issue
Use %zu for printing out results from nitems, as it's size_t based |
313218 |
04-Feb-2017 |
ngie |
MFC r312114,r312194:
r312114:
Enable WARNS?= 6 across all of tests/sys
r312194:
Add include Makefiles for tests/sys/{fs,kern,kqueue,mac}/...
The primary goal for doing this is to leverage the work done in r312114 for enabling WARNS to address trivial code quality issues with new tests
Tested with: make tinderbox |
313217 |
04-Feb-2017 |
ngie |
MFC r312110:
Fix -Wsign-compare warnings
The loop index (i) doesn't need to be size_t as its comparison is signed |
313216 |
04-Feb-2017 |
ngie |
MFC r312120:
Fix warnings
- Staticize test_num - Promote i to size_t to deal with -Wsign-compare issues
Tested with: clang, gcc, gcc49 |
313214 |
04-Feb-2017 |
ngie |
MFC r312119,r312216,r312226:
r312119:
encode_long, encode_timeval: mechanically replace `exp` with `exponent`
This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test, which include math.h, which in turn defines exp(3)
Tested with: clang, gcc 4.2.1, gcc 4.9
r312216:
Revert r312119 and reword the intent to fix -Wshadow issues between exp(3) and `exp` var.
The approach taken previously was not ideal for multiple functional and stylistic reasons.
Add to existing sed call in Makefile to replace `exp` with `exponent` instead.
Requested by: bde
r312226:
Fix typo in r312216
I meant to replace "exp" with "exponent", not "expected"
Pointyhat to: ngie |
312828 |
26-Jan-2017 |
asomers |
MFC r310786, r310803, r310985, r311894
r310786: Reduce the runtime of the GELI tests
There is no reduction in test coverage. On my system runtime is reduced from 38m32s to 6m24s.
tests/sys/geom/class/eli/conf.sh tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh tests/sys/geom/class/eli/onetime_test.sh Move the looping code into common functions in conf.sh, and remove alias ciphers from the list.
tests/sys/geom/class/eli/init_a_test.sh tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/integrity_copy_test.sh tests/sys/geom/class/eli/integrity_data_test.sh tests/sys/geom/class/eli/integrity_hmac_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Move a few commands that don't need to be in the inner loop out.
tests/sys/geom/class/eli/init_test.sh tests/sys/geom/class/eli/onetime_a_test.sh Reduce the sector count
tests/sys/geom/class/eli/Makefile tests/sys/geom/class/eli/init_alias_test.sh Add a test for initializing a GELI device using one of the cipher aliases, and check that the alias is correctly interpreted.
MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8814
r310803: ATFify the gnop tests
Also, add test cases for the -p, -P, and -s options to gnop create
Reviewed by: ngie MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D8892
r310985: Update ObsoleteFiles.inc for r310803
MFC after: 26 days X-MFC-with: 310803
r311894: Fix typo from change 310985 in ObsoleteFiles.inc
MFC after: 16 days X-MFC-With: 310803 Sponsored by: Spectra Logic Corp |
312323 |
17-Jan-2017 |
ngie |
MFC r312111:
Remove unused vars to fix -Wunused issues |
312320 |
17-Jan-2017 |
ngie |
MFC r312118,r312121:
r312118:
Fix -Wformat issue with zero-length format string passed to err(3)
Tested with: clang, gcc 4.2.1, gcc 4.9
r312121:
Follow up to r312118
State that execve failed instead of just printing out the program name and strerror(errno) via err(3). |
310610 |
26-Dec-2016 |
jilles |
MFC r309957: Add tests for reaper receiving SIGCHLD (r309886).
PR: 213928 |
310558 |
25-Dec-2016 |
jilles |
MFC r309836: Add some tests for reaper functionality (in procctl()). |
309662 |
07-Dec-2016 |
ngie |
MFstable/11 r309661:
MFC r306962: r306962 (by br):
Ensure data in pipe is available to read. Useful for latest (5th, direct mode) test only. |
307716 |
21-Oct-2016 |
ngie |
MFstable/11 r307715:
MFC r305916,r305918:
r305916:
Make sure $TMPDIR is created with 0755 permissions
This is required to ensure that the temporary script can be executed, as the default mode is apparently too restrictive
r305918:
Only chmod $TMPDIR if it's not /tmp
This is a safety belt to ensure that the /tmp sticky bit stuff doesn't get whacked by accident if someone runs the script outright |
307065 |
11-Oct-2016 |
jilles |
wait: Do not copyout uninitialized status/rusage/wrusage.
If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and wrusage information should not be returned.
PR: 212048 Reported by: Casey Lucas |
305915 |
18-Sep-2016 |
ngie |
MFstable/11 r305914:
MFC r305357:
Skip testcases 9/10 if jail(8) isn't installed
These testcases require jail support |
305913 |
18-Sep-2016 |
ngie |
MFstable/11 r305912:
MFC r305356:
Add a missing "Bail out!" if zpool create fails
This will make the exit info more meaningful if/when zpool create fails, and establishes parity with the other 2 zfs acl testcases (01, 03). |
305228 |
01-Sep-2016 |
ngie |
MFstable/11 r304947:
MFC r304238:
Only expect :encode_tv_random_million to fail on 64-bit platforms
It passes on i386 |
305227 |
01-Sep-2016 |
ngie |
MFC r304040:
Redirect the output of the testcases to stderr instead of redirecting it to /dev/null
This will aid in debugging failures |
304499 |
19-Aug-2016 |
jhb |
MFC 303001: Add PTRACE_VFORK to trace vfork events.
First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes. |
304188 |
15-Aug-2016 |
jhb |
MFC 302900,302902,302921,303461,304009: Add a mask of optional ptrace() events.
302900: Add a test for user signal delivery.
This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland.
302902: Add a mask of optional ptrace() events.
ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future.
Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask.
The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events.
The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.
The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask.
While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process.
302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.
303461: Note that not all optional ptrace events use SIGTRAP.
New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP.
304009: Remove description of P_FOLLOWFORK as this flag was removed. |
304017 |
12-Aug-2016 |
jhb |
MFC 292894,292896: Add ptrace(2) reporting for LWP events.
292894: Add ptrace(2) reporting for LWP events.
Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting thread creation and destruction. Newly created threads will stop to report PL_FLAG_BORN before returning to userland and exiting threads will stop to report PL_FLAG_EXIT before exiting completely. Both of these events are only enabled and reported if PT_LWP_EVENTS is enabled on a process.
292896: Document the recently added support for ptrace(2) LWP events. |
302687 |
12-Jul-2016 |
asomers |
MFC r302036
Skip sys/acl tests on systems lacking perl
tests/sys/acl/Makefile add perl to the required_programs for all tests in this directory |
301805 |
10-Jun-2016 |
ngie |
MFC r299508: r299508 (by cem):
kern_descrip_test: Fix trivial buffer overrun with readlink(2)
CID: 1229965, 1229972 |
299058 |
04-May-2016 |
ngie |
MFC r298304:
Fix issues identified by Coverity
- Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3). - Remove intermediate variable for assigning from $TMPDIR if set in the environment to eliminate warnings about pointer conversions with "/tmp", and to mute an invalid buffer overflow concern from Coverity (snprintf and tacking on a NUL terminator was alleviating that concern before). - Remove useless self-test of psize before it's initialized. - Check the return values of getrlimit/setrlimit.
Cosmetic changes: - Replace a `(void*)0` with NULL. - Do some minor whitespace clean up. - Remove an unnecessary cast to mmap. - Make all munmap calls use ATF_REQUIRE_MSG instead of using the:
> if (munmap(..) == -1) > atf_tc_fail(..)
idiom. Employ the new idiom consistently when calling munmap.
CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694 |
299057 |
04-May-2016 |
ngie |
MFC r298301:
Fix leaks and test for getpagesize() returning == -1
- close file descriptors after use. - Always munmap memory regions after mmap'ing them. - Make sure getpagesize() returns a value greater than 0 and use a cached value instead of always calling getpagesize(3).
CID: 1331374-1331377, 1331653-1331662 |
298490 |
22-Apr-2016 |
ngie |
MFC r298024,r298196:
r298024:
Set test_argv to NULL, not 0, if not executing a specific test
r298196:
Minor cosmetic cleanup
- Remove spurious trailing whitespace in licensing header - Remove unnecessary semi-colon after comment |
297977 |
14-Apr-2016 |
vangyzen |
MFC r295012
kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT
NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT. Do not let the two events be combined, since one would overwrite the other's data.
PR: 180385 Submitted by: David A. Bright <david_a_bright@dell.com> Sponsored by: Dell Inc. |
297612 |
06-Apr-2016 |
ngie |
MFC r297183:
Use a SKIP testplan instead of bailing out if/when the tester isn't root, or the geom class can't be loaded cleanly [*]
This makes sure that scenarios that are easy to hit aren't counted as false positives with kyua test
PR: 208101 |
296822 |
14-Mar-2016 |
ngie |
MFC r293878,r293880,r295116,r295117,r295477:
r293878:
Remove unnecessary kldload logic added to geom_subr.sh in r293028
r293880:
PID file support hasn't been committed for ggated(8) yet. Unbreak running the testcase more than once by restoring the "killall ggated"
r295116:
Add an additional 1 second sleep to after calling ggatec before calling dd to defeat a race when writing out to the geom_gate(4) device
This will quell the Jenkins failure emails until I come up with a better solution
r295117:
Use the pidfile support added to ggated(8) in r294973 to ensure that the ggated(8) daemon used by the tests is the instance specifically invoked by the tests instead of one or more daemon instances running on the system
r295477:
Similar to r295116, add an additional 1 second sleep after calling ggatel before calling dd to defeat a race when writing out to the geom_gate(4) device |
296821 |
14-Mar-2016 |
ngie |
MFC r293821:
Integrate tools/regression/geom_{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip} in to the FreeBSD test suite as tests/sys/geom/class/{concat,eli,gate,mirror,nop,raid3,shsec,stripe,uzip}
The tools/regression/geom and tools/regression/geom_part testcases are being left alone because both test sets are both currently broken.
The majority of this work was done on ^/user/ngie/more-tests2 . The differences are as follows: - tests/sys/geom/class/Makefile.inc is not present; it was inlined into the class's Makefiles for explicitness. - The testcases officially require root via kyua - The geom_gate(4) tests don't use the pidfile changes proposed in https://reviews.freebsd.org/D4836 . |
296746 |
12-Mar-2016 |
ngie |
MFC r295341,r295345:
r295341:
Require /bin/getfacl and /bin/setfacl when running the acl tests
For cases where these utilities aren't installed, the tests would fail today in a non-intuitive manner on sub-testcase #3 in each of the test scripts
r295345:
Use basenames for getfacl, setfacl, and zpool to work around the fact that Jenkins hardcodes image sizes to 2GB with the FreeBSD_HEAD job
This is to stop the unnecessary failure emails because we've gone over the 2GB limit |
293275 |
06-Jan-2016 |
ngie |
MFC r270228: r270228 (by asomers):
Numerous small fixes, mostly suggested by Coverity.
tests/sys/kern/unix_seqpacket_test.c * Remove a duplicate error check in mk_pair_of_sockets * Always close sockets in the success path of ATF test cases. Don't bother with the error paths, because those are mostly assertions anyway. Most of these socket leaks were reported by Coverity. All of them are harmless, because each ATF test case runs in its own process. * Fix the len argument to send in shutdown_send and shutdown_send_sigpipe. The old version was using sizeof a pointer instead of sizeof the char array. Reported by Coverity. * Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably continue past a failure.
CID: 1229995, 1229991, 1229988, 1229994, 1229989, 1229992 CID: 1229993, 1229990, 1229984, 1229967, 1230005, 1229977 CID: 1229966, 1230004, 1229976 |
293273 |
06-Jan-2016 |
ngie |
MFC r271397: r271397 (by asomers):
Abort the create_socket test if socket creation fails.
CID: 1232756 |
293272 |
06-Jan-2016 |
ngie |
MFC r292914,r292957:
r292914:
Integrate tools/regression/sockets/unix_passfd into the FreeBSD test 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)
https://reviews.freebsd.org/D689
Submitted by: markj
r292957:
Rename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid -Wshadow issues with gcc |
293270 |
06-Jan-2016 |
ngie |
MFC r288961,r288962:
r288961 (by bdrewery):
Fix build with older GCC which, doesn't like 'main' being a variable name.
r288962 (by jhb):
Tweak: use 'mainlwp' instead of 'mainpid' since this is a thread (LWP) identifier, not a pid. |
293257 |
06-Jan-2016 |
ngie |
MFC r292650,r292651:
r292650:
Move mac_bsdextended check up before running the test_libugidfw_strings testcases
I realize that these tests could be run before mac_bsdextended is loaded, but it would overcomplicate things to special case handle the testcases before doing the mac_bsdextended(4) feature check
The testcases will be split up so they can be run separately in the near future
r292651:
Delete the comment about running `test_libugidfw_strings` before testing `mac_is_present` so it doesn't accidentally confuse people |
293251 |
06-Jan-2016 |
ngie |
MFC r292570:
Integrate tools/regression/mac/mac_bsdextended and tools/regression/mac/mac_portacl into the FreeBSD test suite as tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively |
293144 |
04-Jan-2016 |
ngie |
MFC r292822:
Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9 |
293143 |
04-Jan-2016 |
ngie |
MFC r292820:
Clean trailing whitespace |
293140 |
04-Jan-2016 |
ngie |
MFC r292816,r292818,r292819:
r292816:
Place cancel and error under #ifdef DEBUG to mute -Wunused-but-set-variable warnings reported by gcc 4.9
Remove some trailing whitespace as well
Tested with and without -DDEBUG
r292818:
Fix style(9) a bit and ensure that error from initializing kqueue(2) is sane
- Push the kqueue(2) initialization down so the errno will correspond with the failure instead of potentially being stomped on by functions called by `PLAIN_REQUIRE_KERNEL_MODULE` - Delete trailing whitespace - Add spaces between braces for conditional and control blocks (for/if) - Use err/errx instead of perror+printf+exit/printf+exit. - Remove braces for single-line conditionals
Tested with and without -DDEBUG
r292819:
- Fix an improperly sized buffer for `pathname` [1] - Fix a -Wunused-but-set-variable warning [2] |
292854 |
29-Dec-2015 |
ngie |
MFC r292582:
Dump out the output from flock_helper on failure so failures with the test app can be debugged
Obtained from: Isilon OneFS (^/onefs/head@r511419) Sponsored by: EMC / Isilon Storage Division |
292655 |
23-Dec-2015 |
ngie |
MFC r292319:
Add ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for testing for kernel features via the feature_present(3) libcall
The semantics are similar to the other macros in the header (skip testcase with ATF macro; exit with appropriate exit code with the PLAIN macro)
Sponsored by: EMC / Isilon Storage Division |
291817 |
04-Dec-2015 |
bdrewery |
MFC r291331:
Avoid requiring 'make depend' here. |
291815 |
04-Dec-2015 |
bdrewery |
MFC r284289,r288267:
r284289: Misc fixes from projects/bmake r288267: Remove redundant .NOPATH. |
291792 |
04-Dec-2015 |
bdrewery |
MFC r289393:
Add more SUBDIR_PARALLEL. |
291764 |
04-Dec-2015 |
ngie |
MFC r290913,r291181:
r290913:
Port contrib/netbsd-tests/kernel/t_mqueue.c to FreeBSD
- Add missing headers - Ensure mqueuefs is loaded - Make sure the mqueuefs path is absolute and relative to / - Cast the result of mq_open returning -1 to (mqd_t) to mute a compiler warning
Sponsored by: EMC / Isilon Storage Division
r291181:
Integrate contrib/netbsd-tests/kernel/t_mqueue into the FreeBSD test suite as tests/sys/kern/mqueue_test |
291763 |
04-Dec-2015 |
ngie |
MFC r291180:
Fix up convert.c generation
- Use a temporary file for convert.c to reduce likelihood of an interrupted build resulting in bad code being written to convert.c - Truncate the file instead of appending to it to ensure that the file being touched will not result in duplicate declarations/definitions from kern_acct.c if/when kern_acct.c changes. |
291713 |
03-Dec-2015 |
rodrigc |
Fix bad MFC (r291173)
Replace SRCTOP with the relevant path via .CURDIR
Reviewed by: bdrewery |
291183 |
23-Nov-2015 |
ngie |
MFC r290914:
Integrate tools/regression/pipe in to the FreeBSD test suite as tests/sys/kern/pipe
- Fix style(9) bugs - Fix compiler warnings - Use `nitems(x)` instead of `sizeof(x) / sizeof(*x)` pattern
The testcases will be converted over to ATF eventually, but for now will be integrated in as plain C tests
Sponsored by: EMC / Isilon Storage Division |
291179 |
23-Nov-2015 |
ngie |
MFC r290911,r290912:
r290911:
Ignore EINTR from usleep(3) in try_locks(..)
NetBSD's usleep(3) only returns -1/sets errno=EINVAL when `microseconds` is one million or more
Submitted by: pho Sponsored by: EMC / Isilon Storage Division
r290912:
Integrate contrib/netbsd-tests/kernel/t_lockf.c into the FreeBSD test suite as tests/sys/kern/lockf_test
Sponsored by: EMC / Isilon Storage Division |
291173 |
23-Nov-2015 |
ngie |
MFC r290905,r290922:
r290905:
Integrate acct(2) testcase in as tests/sys/kern/acct/acct_test
The :encode_tv_random_million testcase fails the epsilon tests a few thousand times out of one million, so expect the testcase to fail
Submitted by: keramida Sponsored by: EMC / Isilon Storage Division
r290922:
Remove directory made obsolete by r290905
X-MFC note: stable/10 only Sponsored by: EMC / Isilon Storage Division |
290894 |
16-Nov-2015 |
ngie |
MFC r289446:
Integrate tools/regression/acltools into the FreeBSD test suite as tests/sys/acl
- Make the requirements more complete for the testcases - Detect prerequisites so the tests won't fail (zfs.ko is loaded, zpool(1) is available, ACL support is enabled with UFS, etc). - Work with temporary files/directories/mountpoints that work with atf/kyua - Limit the testcases to work on temporary filesystems to reduce tainting the test host
Reviewed by: trasz (earlier version) Differential Revision: https://reviews.freebsd.org/D3810 |
290585 |
09-Nov-2015 |
ngie |
MFC r289441:
Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD test suite as tests/sys/posixshm
Some other highlights: - Convert the testcases over to ATF - Don't use hardcoded paths to /tmp (which violate the ATF/kyua samdbox); use mkstemp to generate temporary paths for non-SHM_ANON shm objects.
Sponsored by: EMC / Isilon Storage Division |
289985 |
26-Oct-2015 |
ngie |
MFC r289300:
Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs
Sponsored by: EMC / Isilon Storage Division |
289780 |
23-Oct-2015 |
jhb |
MFC 287386,288949,288993: Export current system call code and argument count for system call entry and exit events. To preserve the ABI, the new fields are moved to the end of struct thread in these branches (unlike HEAD) and explicitly copied when new threads are created. In addition, the new tests are only added in 10.
r287386: Export current system call code and argument count for system call entry and exit events. procfs stop events for system call tracing report these values (argument count for system call entry and code for system call exit), but ptrace() does not provide this information. (Note that while the system call code can be determined in an ABI-specific manner during system call entry, it is not generally available during system call exit.)
The values are exported via new fields at the end of struct ptrace_lwpinfo available via PT_LWPINFO.
r288949: Fix various edge cases related to system call tracing. - Always set td_dbg_sc_* when P_TRACED is set on system call entry even if the debugger is not tracing system call entries. This ensures the fields are valid when reporting other stops that occur at system call boundaries such as for PT_FOLLOW_FORKS or when only tracing system call exits. - Set TDB_SCX when reporting the stop for a new child process in fork_return(). This causes the event to be reported as a system call exit. - Report a system call exit event in fork_return() for new threads in a traced process. - Copy td_dbg_sc_* to new threads instead of zeroing. This ensures that td_dbg_sc_code in particular will report the system call that created the new thread or process when it reports a system call exit event in fork_return(). - Add new ptrace tests to verify that new child processes and threads report system call exit events with a valid pl_syscall_code via PT_LWPINFO.
r288993: Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo. |
288467 |
01-Oct-2015 |
jhb |
MFC 287448: Add more mmap tests related to character devices. - Add cdev-related tests for bad args. - Add two simple tests cases for mapping /dev/zero that test for MAP_ANON-like behavior. |
288466 |
01-Oct-2015 |
jhb |
MFC 286370: Add various tests to ensure that invalid arguments passed to mmap() trigger failures.
Note: most of the tests that should provoke an EINVAL error do not pass on stable/10 as stable/10 does not have the changes that added more strict parameter checking to mmap(). Those changes will not be merged to stable/10, so I have disabled them via #if 0 with a comment explaining why. |
288465 |
01-Oct-2015 |
jhb |
MFC 286369: Convert the map_at_zero test case to ATF. In particular, this will facilitate adding more mmap() tests. |
287604 |
09-Sep-2015 |
jhb |
MFC 283281,283282,283562,283647,283836,284000,286158: Various fixes to orphan handling which also fix issues with following forks.
283281: Always set p_oppid when attaching to an existing process via procfs tracing. This matches the behavior of ptrace(PT_ATTACH). Also, the procfs detach request assumes p_oppid is always set.
283282: Only reparent a traced process to its old parent if the tracing process is not the old parent. Otherwise, proc_reap() will leave the zombie in place resulting in the process' status being returned twice to its parent.
Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by this change.
283562: Do not allow a process to reap an orphan (a child currently being traced by another process such as a debugger). The parent process does need to check for matching orphan pids to avoid returning ECHILD if an orphan has exited, but it should not return the exited status for the child until after the debugger has detached from the orphan process either explicitly or implicitly via wait().
Add two tests for for this case: one where the debugger is the direct child (thus the parent has a non-empty children list) and one where the debugger is not a direct child (so the only "child" of the parent is the orphan).
283647: Tweak the description of when waitpid() doesn't return any status for a non-blocking wait to avoid the word "empty".
283836: Consistently only use one end of the pipe in the parent and debugger processes and do not rely on EOF due to a close() in the debugger.
284000: Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes of the main test process.
286158: Clear P_TRACED before reparenting a detached process back to its original parent. Otherwise the debugee will be set as an orphan of the debugger.
Add tests for tracing forks via PT_FOLLOW_FORK. |
286612 |
11-Aug-2015 |
rodrigc |
Merge r285891:
Pass unsigned long argument to ioctl().
Eliminates "ioctl sign-extension" warnings.
PR: 200896 |
283846 |
31-May-2015 |
ngie |
MFC r277627,r277650,r282059,r283056,r283840,r283845:
r277627 (by will):
Add routing_test:static_ipv6_loopback_route_for_each_fib. It tests that all FIBs get a static IPv6 loopback route.
Submitted by: asomers Sponsored by: Spectra Logic MFSpectraBSD: 1048456 on 2014/03/13 1114523 on 2015/01/23
r277650 (by will):
Add tests/etc/rc.d to mtree.
Submitted by: stefanf MFC with: 277627
r282059:
Move etc/tests/rc.d to etc/rc.d/tests to match the directory layout jmmv@ documented and implemented in other areas of the FreeBSD tree
r283056:
Move all test integration pieces for etc/ from etc/ to tests/
This is being done to fix breakage with make distribution with read-only source trees as make distribution doesn't use make obj like building tests/ does in all cases
Reported by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org> Suggested by: jhb
r283840:
Remove empty tests directory
r283845:
Append to SUBDIR, not set it
Pointyhat to: ngie |
283021 |
16-May-2015 |
ngie |
MFC r282061:
Integrate tools/regression/execve into the FreeBSD test suite as tests/sys/kern/execve |
282860 |
13-May-2015 |
ngie |
MFC r262781,r263336:
r262781 (by pho):
Preserve naming consistency for test cases.
Pointed out by: jmmv Sponsored by: EMC / Isilon storage division
r263336 (by pho):
Added sysctl kern.maxfiles increase test, do not use /etc/passwd for tests and use volatile sig_atomic_t for signal handler variable.
Reviewed by: asomers (previous version) Sponsored by: EMC / Isilon storage division |
282859 |
13-May-2015 |
ngie |
MFC r282211,r282244:
r282211:
ATF_REQUIRE_KERNEL_MODULE: use atf_skip, not ATF_REQUIRE_MSG so the testcase no longer bombs out PLAIN_REQUIRE_KERNEL_MODULE: use printf + _exit, no err so the testcase no longer bombs out if it prints to stderr
r282244:
Fix typo. It should have been atf_tc_skip, not atf_skip
Reported by: many, Jenkins Pointyhat to: ngie |
282858 |
13-May-2015 |
ngie |
MFC r281593,r282071,r282074,r282133,r282134,r282135,r282136,r282137,r282138:
r282071:
Integrate tools/regression/mqueue into the FreeBSD test suite as tests/sys/mqueue
r282074:
Integrate tools/regression/aio/aiotest and tools/regression/aio/kqueue into the FreeBSD test suite as tests/sys/aio
r282133:
Fill in the copyright boilerplate for the test program
r282134:
Add initial (unpolished) macros for interfacing with the FreeBSD test suite
This is very rough, but will be replaced/redesigned some time soon after I fix the Jenkins breakage I introduced
r282135:
Use ATF_REQUIRE_KERNEL_MODULE instead of aio_available function
r282136:
- Use ATF_REQUIRE_KERNEL_MDOULE to require aio(4) - Don't use /tmp as a basis for temporary files as it's outside of the ATF sandbox - Don't override MAX macro in sys/param.h
r282137:
Use PLAIN_REQUIRE_KERNEL_MODULE to require "mqueuefs"
r282138:
Adjust CFLAGS to find freebsd_test_suite/macros.h |
282853 |
13-May-2015 |
ngie |
MFC r282076,r282104:
r282076:
Integrate tools/regression/mmap into the FreeBSD test suite as tests/sys/kern/mmap_test
r282104:
Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_test
As jhb noted, the actual mmap(2) implementation is under sys/vm, not sys/kern/, so the correct logical place is tests/sys/vm/, not tests/sys/kern/ |
282850 |
13-May-2015 |
ngie |
MFC r262526,r262730:
r262526 (by pho):
Added a regression test for r234131.
Discussed with: asomers Sponsored by: EMC / Isilon storage division
r262730 (by pho):
Changed name of test case to a more descriptive one and moved comment to the "descr" property.
Suggested by: jmmv Sponsored by: EMC / Isilon storage division |
282842 |
13-May-2015 |
ngie |
MFC r282067:
Integrate tools/regression/fifo into the FreeBSD test suite as tests/sys/fifo and tools/regression/file into the FreeBSD test suite as tests/sys/file |
282841 |
13-May-2015 |
ngie |
MFC r282063:
Integrate tools/regression/kqueue into the FreeBSD test suite as tests/sys/kqueue |
276486 |
31-Dec-2014 |
ngie |
MFC r264400,r265836:
r264400:
NO_MAN= has been deprecated in favor of MAN= for some time, go ahead and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit.
r265836:
Remove last two NO_MAN= in the tree. In both of these cases, MAN= is what is needed. |
275504 |
05-Dec-2014 |
ngie |
MFC r272057,r272083,r272084,r272087,r274016:
r272057:
Import pjdfstest from ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91
- Remove tools/regression/pjdfstest - Add upgrade directions for contrib/pjdfstest - Add a note to UPDATING for the move (the reachover Makefiles are coming soon)
Functional differences: - ftruncate testcases are added from upstream (github)
Non-functional differences: - The copyright for the project has been updated to 2012 - pjd's contact information has been updated
Discussed with: -testing, jmmv, pjd Sponsored by: EMC / Isilon Storage Division
r272083:
Expect ELOOP on Darwin/Linux with "O_NOFOLLOW was specified and the target is a symbolic link" case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris, etc)
Sponsored by: EMC / Isilon Storage Division
r272084:
Fix the executed testplan count
Sponsored by: EMC / Isilon Storage Division
r272087:
Increase the memory disk size in the following testcases to avoid mount failures, which would cause cascade failures in the rest of the test run:
link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t
Fail quickly in all of the testcases if mdconfig, mount, umount, etc fails to avoid issues similar to this in the future
Submitted by: Casey Peel <cpeel@isilon.com> Sponsored by: EMC / Isilon Storage Division
r274016:
Integrate pjdfstest test suite execution into kyua
pjdfstest execution is opt-in and must be done as root due to some of the assumptions made by the test suite and lack of error checking in the non-root case
A description of how to execute pjdfstest with kyua is provided in share/pjdfstest/README
Phabric: D824 (an earlier prototype patch) Relnotes: yes Sponsored by: EMC / Isilon Storage Division |
274541 |
15-Nov-2014 |
ngie |
MFC r274021:
Remove explicit KYUAFILE=yes from tests/sys/Makefile
This causes the directory traversing Kyuafile to be installed, which in turn causes tests/sys/pjdfstest to always be run from /usr/tests/sys
Let KYUAFILE default to auto, so the file generated by suite.test.mk gets installed instead |
274540 |
15-Nov-2014 |
ngie |
MFC r274052:
Remove unused tests/lib directory |
274539 |
15-Nov-2014 |
ngie |
MFC r274267:
Use PROGS instead of PROG and remove unnecessary SRCS?= assignment
Using PROG instead of PROGS will in cases of high -j with -DNO_ROOT cause the PROG to show up more than once as it's handling the SCRIPTS install case in a recursive manner, separate from the non-recursive case
After the recent batch of commits to bsd.progs.mk to fix behavior with how variables are defaulted to, explicitly setting SRCS for a PROG is no longer required
Reviewed by: asomers Phabric: D1130 Sponsored by: EMC / Isilon Storage Division |
267195 |
06-Jun-2014 |
asomers |
MFC changes related to PR kern/189089. Unlike CURRENT, stable/10 does not panic when you attempt to remove the IP address. But it still fails to remove the address.
MFC r265094
Add regression test for PR kern/189088.
MFC r265092
Fix a panic when removing an IP address from an interface, if the same address exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. |
267193 |
06-Jun-2014 |
asomers |
MFC r264887
Fix host and network routes for new interfaces when net.add_addr_allfibs=0
sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib.
tests/sys/netinet/fibs_test.sh Clear the expected ATF failure
sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib
sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. |
267186 |
06-Jun-2014 |
asomers |
MFC changes relating to running multiple interfaces on different fibs but with addresses on the same subnet.
MFC r266860
Fix unintended KBI change from r264905. Add _fib versions of ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior.
sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum.
sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise.
tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c Improve the udp_dontroute test. The bug that this test exercises is that ifa_ifwithnet() will return the wrong address, if multiple interfaces have addresses on the same subnet but with different fibs. The previous version of the test only considered one possible failure mode: that ifa_ifwithnet_fib() might fail to find any suitable address at all. The new version also checks whether ifa_ifwithnet_fib() finds the correct address by checking where the ARP request goes.
MFC r264917
Style fixes, mostly trailing whitespace elimination. No functional change.
MFC r264905
Fix subnet and default routes on different FIBs on the same subnet.
These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address.
sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument.
sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments.
sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib.
sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553.
tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile Revert r263738. The udp_dontroute test was right all along. However, bugs kern/187550 and kern/187553 cancelled each other out when it came to this test. Because of kern/187553, ifa_ifwithnet searched the default fib instead of the requested one, but because of kern/187550, there was an applicable subnet route on the default fib. The new test added in r263738 doesn't work right, however. I can verify with dtrace that ifa_ifwithnet returned the wrong address before I applied this commit, but route(8) miraculously found the correct interface to use anyway. I don't know how.
Clear expected failure messages for kern/187550 and kern/187552.
MFC r263738
tests/sys/netinet/Makefile tests/sys/netinet/fibs.sh Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet. The original test was poorly written; it was actually testing kern/167947 instead of the desired kern/187553. The root cause of the bug is that ifa_ifwithnet did not have a fib argument. The new test more directly targets that behavior.
tests/sys/netinet/udp_dontroute.c Delete the auxilliary binary used by the old test |
267175 |
06-Jun-2014 |
asomers |
MFC r263779
Correct ARP update handling when the routes for network interfaces are restricted to a single FIB in a multifib system.
Restricting an interface's routes to the FIB to which it is assigned (by setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve: can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard coding it's lookup for existing routing entries to FIB 0.
sys/netinet/in.c: When dealing with RTM_ADD (add route) requests for an interface, use the interface's assigned FIB instead of the default (FIB 0).
sys/netinet/if_ether.c: In arpresolve(), enhance error message generated when an lla_lookup() fails so that the interface causing the error is visible in logs.
tests/sys/netinet/fibs_test.sh Clear ATF expected error. |
265586 |
07-May-2014 |
asomers |
MFC r263445 and r265385. Note that the change to ObsoleteFiles.inc in r265385 does not need to be MFCed, because the obsolete files in question were never MFCed to any stable branch.
r265385 Remove the ifconfig test added in rev 263445. After discussion with melifaro, we agreed that ifconfig's behavior was not a bug. The main motivation for bin/187551 was to partially resolve kern/187549, but we resolved kern/187549 in a different way instead.
ObsoleteFiles.inc etc/mtree/BSD.tests.dist sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Remove /usr/tests/sbin/ifconfig
r263445 Add several ATF tests that deal with multiple fibs. They're described in several different PRs, but the tests share some common code, so I'm committing them together.
sbin/ifconfig/tests sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Add fibs_test.sh, which regresses bin/187551
tests/sys/netinet tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile tests/sys/Makefile Add fibs_test.sh, which regresses kern/167947, kern/187552 kern/187549, kern/187550, and kern/187553
etc/mtree/BSD.tests.dist Add newly created directories |
264607 |
17-Apr-2014 |
jmmv |
MFC r264133: Fix variable type to avoid printf formatter warning. |
264483 |
14-Apr-2014 |
jmmv |
MFC refactoring of the *.test.mk files.
- r263161 Make bsd.test.mk the only public mk fragment for the building of tests. - r263172 Move FreeBSD Test Suite-specific code to a suite.test.mk file. - r263204 Add some documentation for bsd.test.mk. - r263217 Document support for TAP-compliant Perl test programs.
This is "make tinderbox" clean. |
264080 |
03-Apr-2014 |
asomers |
MFC r263116
Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner mechanism, based on the new SB_STOP sockbuf flag. The old hack dynamically changed the sending sockbuf's high water mark whenever adding or removing data from the receiving sockbuf. It worked for stream sockets, but it never worked for SOCK_SEQPACKET sockets because of their atomic nature. If the sockbuf was partially full, it might return EMSGSIZE instead of blocking.
The new solution is based on DragonFlyBSD's fix from commit 3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27. It adds an SB_STOP flag to sockbufs. Whenever uipc_send surpasses the socket's size limit, it sets SB_STOP on the sending sockbuf. sbspace() will then return 0 for that sockbuf, causing sosend_generic and friends to block. uipc_rcvd will likewise clear SB_STOP. There are two fringe benefits: uipc_{send,rcvd} no longer need to call chgsbsize() on every send and receive because they don't change the sockbuf's high water mark. Also, uipc_sense no longer needs to acquire the UIPC linkage lock, because it's simpler to compute the st_blksizes.
There is one drawback: since sbspace() will only ever return 0 or the maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum size by at most one packet of size less than the max. I don't think that's a serious problem. In fact, I'm not even positive that FreeBSD guarantees a socket will always stay within its nominal size limit.
sys/sys/sockbuf.h Add the SB_STOP flag and adjust sbspace()
sys/sys/unpcb.h Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb.
sys/kern/uipc_usrreq.c Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP backpressure mechanism. Removing obsolete unpcb fields from db_show_unpcb.
tests/sys/kern/unix_seqpacket_test.c Clear expected failures from ATF. |
263820 |
27-Mar-2014 |
asomers |
MFC r262867
Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets". It was caused by a check for the space available in a sockbuf, but it was checking the wrong sockbuf.
sys/sys/sockbuf.h sys/kern/uipc_sockbuf.c Add sbappendaddr_nospacecheck_locked(), which is just like sbappendaddr_locked but doesn't validate the receiving socket's space. Factor out common code into sbappendaddr_locked_internal(). We shouldn't simply make sbappendaddr_locked check the space and then call sbappendaddr_nospacecheck_locked, because that would cause the O(n) function m_length to be called twice.
sys/kern/uipc_usrreq.c Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, because the receiving sockbuf's size limit is irrelevant.
tests/sys/kern/unix_seqpacket_test.c Now that 185813 is fixed, pipe_128k_8k fails intermittently due to 185812. Make it fail every time by adding a usleep after starting the writer thread and before starting the reader thread in test_pipe. That gives the writer time to fill up its send buffer. Also, clear the expected failure message due to 185813. It actually said "185812", but that was a typo.
PR: kern/185813 |
263572 |
21-Mar-2014 |
asomers |
MFC r262868
Only use -lpthread for unix_seqpacket_test, not for all test programs.
MFC r262894
kern/Makefile Set WARNS=5 for all files in this directory kern/unix_seqpacket_test.c Fix compiler warnings. Most were benign, but rcvbuf_oversized wasn't working as intended because I forgot to set the buffer sizes. |
262871 |
06-Mar-2014 |
asomers |
MFC r262133
test_eagain_*_* should've been using nonblocking sockets instead of blocking sockets. The error was not exposed as long as the kernel suffered from PR kern/185812. Now corrected, these tests pass on DragonFlyBSD 3.6.0. |
262854 |
06-Mar-2014 |
jmmv |
Install a symlink from /usr/tests/local to /usr/local/tests.
This is a MFC of r261959 and r261978. |
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. |
260013 |
28-Dec-2013 |
jmmv |
Set up the /usr/tests hierarchy.
This is a MFC of the following into stable/10: - r257097 Set up the /usr/tests hierarchy. - r257098 Add missing WITHOUTTESTS file. - r257100 Add a tests(7) manual page. - r257105 Disable WITHTESTS= for now. - r257848 Fix buildworld when WITHTESTS is enabled. - r257850 Subsume the functionality of MKATF into MKTESTS. - r257851 Handle the removal of the test suite when WITHOUTTESTS=yes. - r257852 Install category Kyuafiles from their category directories. - r258232 Install BSD.tests.mtree when MKTESTS is yes.
Note that building with WITH_TESTS is still broken at this point (and hence why WITHOUT_TESTS is the set as the default). Subsequent pullups will fix the remaining issues. |
257097 |
25-Oct-2013 |
rpaulo |
Set up the /usr/tests hierarchy.
Populate /usr/tests with the only test programs that currently live in the tree (those in lib/libcrypt/tests/) and add all the build machinery to accompany this change.
In particular:
- Add a WITHOUT_TESTS variable that users can define to request that no tests be put in /usr/tests. - Add a top-level Kyuafile for /usr/tests and a way to create similar Kyuafiles in top-level subdirectories. - Add a BSD.tests.dist file to define the directory layout of /usr/tests.
Submitted by: Julio Merino jmmv google.com Reviewed by: sjg MFC after: 2 weeks
|