Commit Graph
191 Commits
Author SHA1 Message Date
Enji Cooper 54015da299 MFC r321702,r321703:
r321702:

Load geom_gate(4) if necessary before running tests; skip if it can't be loaded

The test code prior to r311893 loaded geom_gate at test start if necessary and
skipped the tests if it couldn't be loaded.

The ATF-ifcation of this test done in r311893 unfortunately dropped this
functionality.

This change restores the geom_gate module load and skips the test(s) if unavailable
in an ATF-like way.

PR:		220164

r321703:

Remove superfluous `exit 0` added in r321702

atf_skip triggers equivalent functionality, which means the `exit 0`
is unreachable code.

PR:		220164
MFC with:	r321702
2017-09-08 04:39:59 +00:00
Alan Somers 7da323661c MFC r322255:
tests/sys/netinet/fibs_test: skip selected tests when firewalls are enabled

Some tests send packets over epair(4) interfaces. Firewalls can cause
spurious failures.

Reviewed by:	ngie
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11917
2017-09-07 19:57:31 +00:00
Ryan Libby a94bc93a16 MFC r316397 (by bde):
Remove the unportable -msse4 here too after fixing crc32_sse42.c to
  not depend on it.  This should have been part of r315983.

Note, r315983 was MFC'd to stable/11 in r317149.

Approved by:	markj (mentor)
2017-09-05 15:21:34 +00:00
Alan Somers b01eebf91a MFC r321332:
Implement SIGEV_THREAD notifications for lio_listio(2)

Our man pages have always indicated that this was supported, but in fact the
feature was never implemented for lio_listio(2).

Reviewed by:	jhb, kib (earlier version)
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11680
2017-08-25 14:42:11 +00:00
Alan Somers 65ff2f9a93 MFC r321082:
Add regression tests for bugs 220459 and 220398

Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0
Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD

PR:		220459
PR:		220398
Reviewed by:	cem, jhb
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11470
2017-08-25 14:37:23 +00:00
Alan Somers 315a4d87db MFC r320974-r320975, r321001, r321206
r320974:
Use ATF cleanup routines in aio_test.c

Remove aio_test's legacy timeout handling and cleanup routines.  Instead,
use ATF's builtin capabilities.  ATF automatically cleans up newly created
files, too, so we don't have to explicitly unlink them.  The only tests than
need a cleanup routine are the md(4) tests, which must destroy their md
device.

Reviewed by:	jhb
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11468

r320975:
Add tests for aio(4) completion notification via signals and threads

Reviewed by:	jhb
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11468

r321001:
Fix the build with GCC after r320975

Reported by:	pfg
X-MFC-With:	320975
Sponsored by:	Spectra Logic Corp

r321206:
Remove dead code that was killed by r320975

Reported by:	Coverity
CID:		1377977
X-MFC-With:	320975
Sponsored by:	Spectra Logic Corp
2017-08-25 14:32:03 +00:00
Enji Cooper d18f2b72bd MFC r321959:
Annotate tests that require root privileges appropriately

This unbreaks running the tests with unprivileged users.
2017-08-19 01:49:09 +00:00
Enji Cooper 3348129aa8 MFC r320446:
trailing_slash is a TAP-compliant testcase; mark it as such, instead
of calling is a plain testcase.
2017-07-28 03:25:58 +00:00
Enji Cooper 5e75bdd6c1 MFC r320445:
Don't hardcode path to file in /tmp; this violates the kyua sandbox
2017-07-28 03:25:01 +00:00
Enji Cooper 6949587bf4 MFC r319063:
Send all of `data`, not just a portion of it

It was sending only a long's worth (4 or 8 bytes) of data previously
(instead of the entire buffer) via send(2).

CID:		1229966, 1229967, 1230004, 1230005
2017-07-18 18:51:34 +00:00
Enji Cooper 88e24c50b8 MFC r318180:
Mark all md tests as requiring unsafe AIO in order to function

These tests have been flapping (failing<->passing) on Jenkins for months.
It passes reliably for me if unsafe AIO is permitted, but it doesn't
pass on Jenkins reliably if unsafe AIO is disabled (the current default).

Mark the tests as requiring unsafe AIO to mitigate the intermittent
failures when unsafe AIO isn't permitted. If the kernel code is changed
to reliably function with md(4) devices using unsafe AIO, this commit can
be reverted.

PR:		217261
2017-07-17 21:17:03 +00:00
Enji Cooper 8be5665413 MFC r319455,r319456:
r319455:

Fix up `TEST_METADATA`

- `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak
  trying to run the tests on a system without python installed in $PATH.
- The tests require root because they load aesni(4) and/or cryptodev(4) if
  not already loaded.

r319456:

tests/sys/opencrypto/runtests: apply minor polish to test script

- Refactor kld loading/unloading logic:
-- Use a loop instead of an unrolled one.
-- Check for the module being loaded before trying to load it, to reduce
   noise when loading modules that are already loaded.
-- Don't mute stderr from kldload -- it could be potentially useful to
   the tester.
-- In the event that the test script was terminated early, it would leave
   the modules still attached to the system (which is undesirable).
   Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the
   system is returned to its former operating state as best possible.
   Unload the modules in reverse order, in part for consistency and/or
   dependency reasons.
2017-07-10 05:34:37 +00:00
Alan Somers 30d0d07ea2 MFC r312919 (by rwatson)
Fix build of aio_test on MIPS, where the compiler warns about the local
variable 'err' shadowing the global function err(3).  Which it does.

Sponsored by: DARPA, AFRL
Approved by:  re
2017-06-02 15:11:43 +00:00
Michael Tuexen 5ec411acd2 MFC r317512:
armv8 has support for optional CRC32C instructions. This patch checks if they are
available and if that is true make use of them.
Thank you very much to Andrew Turner for providing help and review the patch!

Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D10499
2017-06-01 09:00:38 +00:00
Enji Cooper c241342e08 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
2017-05-31 08:36:43 +00:00
Enji Cooper 1c35b8917f MFC r319062:
Initial `srv` before using it in bind(2)

CID:		1357526
2017-05-31 08:07:51 +00:00
Alan Somers 31b11ab478 MFC r318593:
Fix build of AIO tests with -DDEBUG

Also, redefine some constants for clarity.  No functional change.
2017-05-30 15:33:27 +00:00
Enji Cooper debef1a699 MFC r312913,r318100,r318107:
r312913 (by asomers):

Improve the aio tests

* Add tests for aio_suspend(2).
* Add tests for polled completion notification.
* Test the full matrix of file descriptor types and completion notification
  mechanisms.
* Don't bother with mkstemp, because ATF runs every test in its own temp dir.
* Fix some typos.
* Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.

r318100:

style(9): move function definition curly braces to column 0

r318107:

Remove unused constant (PATH_TEMPLATE)

It was made unnecessary in r312913.

MFC with:	r312913
2017-05-30 03:09:01 +00:00
Enji Cooper a1c4375a07 MFC r318094,r318098,r318099:
r318094:

style(9): clean up trailing whitespace

r318098:

Refactor ATF_REQUIRE_UNSAFE_AIO and PLAIN_REQUIRE_UNSAFE_AIO

This is being done to reduce duplication between the two macros.

r318099:

Print out when unsafe AIO is enabled to debugging purposes
2017-05-30 03:05:22 +00:00
Enji Cooper a0c429db99 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.
2017-05-27 22:59:23 +00:00
Brooks Davis 1dfcb15e54 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
2017-05-05 15:15:41 +00:00
Mark Johnston 29cc97518f MFC r313006 (by cem), r315983 (by bde):
Add an SSE4.2 implementation of crc32 for x86.
2017-04-19 16:16:41 +00:00
Alan Somers 65f4ff4020 MFC r313025, r313395, r314113, r314442, r315458, r315656
r313025:
Add tests for multi-fib IPv6 routing

PR:		196361
Submitted by:	[email protected]
Reported by:	Jason Healy <[email protected]>
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp

r313395:
Add fibs_test:udp_dontroute6, another IPv6 multi-FIB test

PR:		196361
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp

r314113:
Remove tests/sys/netinet/fibs_tests's dependency on net/socat

Instead of bridging two tap interfaces with socat, just use an epair pair.

MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp

r314442:
Add an ATF test for IPv6 SLAAC with multiple fibs

Tests that an interface can get a SLAAC address and that it inserts its
routes into the correct fib. Does not test anything to do with NDP.

PR:		196361
Reviewed by:	Erick Turnquist <[email protected]>
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9776

r315458:
Constrain IPv6 routes to single FIBs when net.add_addr_allfibs=0

sys/netinet6/icmp6.c
	Use the interface's FIB for source address selection in ICMPv6 error
	responses.

sys/netinet6/in6.c
	In in6_newaddrmsg, announce arrival of local addresses on the
	interface's FIB only.  In in6_lltable_rtcheck, use a per-fib ND6
	cache instead of a single cache.

sys/netinet6/in6_src.c
	In in6_selectsrc, use the caller's fib instead of the default fib.
	In in6_selectsrc_socket, remove a superfluous check.

sys/netinet6/nd6.c
	In nd6_lle_event, use the interface's fib for routing socket
	messages.  In nd6_is_new_addr_neighbor, check all FIBs when trying
	to determine whether an address is a neighbor.  Also, simplify the
	code for point to point interfaces.

sys/netinet6/nd6.h
sys/netinet6/nd6.c
sys/netinet6/nd6_rtr.c
	Make defrouter_select fib-aware, and make all of its callers pass in
	the interface fib.

sys/netinet6/nd6_nbr.c
	When inputting a Neighbor Solicitation packet, consider the
	interface fib instead of the default fib for DAD.  Output NS and
	Neighbor Advertisement packets on the correct fib.

sys/netinet6/nd6_rtr.c
	Allow installing the same host route on different interfaces in
	different FIBs.  If rt_add_addr_allfibs=0, only install or delete
	the prefix route on the interface fib.

tests/sys/netinet/fibs_test.sh
	Clear some expected failures, but add a skip for the newly revealed
	BUG217871.

PR:		196361
Submitted by:	Erick Turnquist <[email protected]>
Reported by:	Jason Healy <[email protected]>
Reviewed by:	asomers
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9451

r315656:
Fix back-to-back runs of sys/netinet/fibs_test;slaac_on_nondefault_fib6

This test was failing if run twice because rtadvd takes too long to die.
The rtadvd process from the first run was still running when the
second run created its interfaces.  The solution is to use SIGKILL during
the cleanup instead of SIGTERM so rtadvd will die faster.

While I'm here, randomize the addresses used for the test, which makes bugs
like this easier to spot, and fix the cleanup order to be the opposite of
the setup order

PR:		217871
MFC after:	18 days
X-MFC-With:	315458
Sponsored by:	Spectra Logic Corp
2017-04-17 20:13:20 +00:00
Alan Somers 0c1dd51bd4 MFC r314056:
Improve pjdfstest run instructions

In the Kyua era, it's no longer necessary to set PJDFSTEST_TEST_PATH.  Just
use TMPDIR instead.

Reviewed by:	ngie
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9340
2017-04-02 03:00:50 +00:00
Eric Badger 058c036a96 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
2017-03-25 20:14:08 +00:00
Eric Badger 4549f39ebc 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
2017-03-25 13:33:23 +00:00
Enji Cooper befabfd4fb MFC r313439,r314450:
r313439:

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 <[email protected]>

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
2017-03-07 01:52:56 +00:00
Alan Somers 91b0a756fa MFC r311893, r313008, r313081
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
2017-02-15 00:15:24 +00:00
Jilles Tjoelker 4148ea7060 MFC r310096: reaper: Make REAPER_KILL_SUBTREE actually work. 2017-02-05 20:55:01 +00:00
Enji Cooper 7358e5e5e9 MFC r312114:
Enable WARNS?= 6 across all of tests/sys
2017-02-04 17:02:54 +00:00
Enji Cooper 6e03692ebb MFC r312120:
Fix warnings

- Staticize test_num
- Promote i to size_t to deal with -Wsign-compare issues

Tested with:	clang, gcc, gcc49
2017-02-04 17:01:53 +00:00
Enji Cooper 06c02b9b81 MFC r312110:
Fix -Wsign-compare warnings

The loop index (i) doesn't need to be size_t as its comparison is signed
2017-02-04 16:58:06 +00:00
Enji Cooper e7049d111c MFC r312164:
Fix -Wformat issue

Use %zu for printing out results from nitems, as it's size_t based
2017-02-04 16:56:51 +00:00
Enji Cooper f771ced2c0 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
2017-02-04 16:02:48 +00:00
Alan Somers 11fe96ef14 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
2017-01-26 20:15:14 +00:00
Enji Cooper 6a886953f0 MFC r312111:
Remove unused vars to fix -Wunused issues
2017-01-17 01:56:44 +00:00
Enji Cooper 5618b972d0 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).
2017-01-17 01:55:14 +00:00
Enji Cooper ae5efe96ee MFC r309464:
Expect 01:main to fail

Changes were made to ZFS in the past year with respect to how ACLs
are handled, causing failures in this test. Mark it TODO so (hopefully)
someone more knowledgeable (like mav or trasz) will fix the code or the
test.

PR:	212323
2017-01-14 10:23:05 +00:00
Konstantin Belousov 831141be84 MFC r311522:
Use type-independent formats for printing nlink_t and ino_t.
2017-01-13 13:37:09 +00:00
Bryan Drewery 02c408bb66 MFC r305148:
DIRDEPS_BUILD: Add some missing dirctories to the build.
2017-01-03 22:51:40 +00:00
Jilles Tjoelker 467cd10102 MFC r309957: Add tests for reaper receiving SIGCHLD (r309886).
PR:		213928
2016-12-26 14:39:05 +00:00
Jilles Tjoelker 0465e83f23 MFC r309836: Add some tests for reaper functionality (in procctl()). 2016-12-18 15:10:08 +00:00
Enji Cooper 274e90f02b MFC r306030,r306031,r306033,r306036,r306038,r307190,r307196,r307204,r307205,r307701,r307702:
r306030:

Port vnode_leak_test:main to FreeBSD

Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

r306031:

Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD

Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

r306033:

Port sizes_test and statvfs_test to FreeBSD

Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

r306036:

Port to mknod_test and readdir_test to FreeBSD

The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

r306038:

Port vnd_test to FreeBSD

Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

r307190:

Skip :uchg on FreeBSD

Unfortunately removing files with uchg set always succeeds with root on
FreeBSD. Unfortunately running the test as an unprivileged user isn't doable
because mounting tmpfs requires root

PR:		212861

r307196:

Port contrib/netbsd-tests/fs/tmpfs/h_tools.c to FreeBSD

- Add inttypes.h #include for PRId64 macro
- Use FreeBSD's copy of getfh(2), which doesn't include a `fh_size` parameter.
  Use sizeof(fhandle_t) instead as the size of fhp is always fixed as
  fhandle_t, unlike NetBSD's copy of fhp, which is void*.

r307204:

Expect :large to fail on FreeBSD

FreeBSD doesn't appear to validate large -o size values like
NetBSD does

PR:		212862

r307205:

Change atf_skip call to atf_expect_fail to make it clear that a failure is
expected

PR:		212861
Suggested by:	jmmv

r307701:

Expect tests/sys/fs/tmpfs/link_test:kqueue to fail

It fails with: "dir/b did not receive NOTE_LINK"

Also, add needed cleanup logic to cleanup the mountpoint after the fact

PR:		213662

r307702:

Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support
2016-12-07 06:57:08 +00:00
Enji Cooper 8b544dec56 MFC r306962:
r306962 (by br):

Ensure data in pipe is available to read.
Useful for latest (5th, direct mode) test only.
2016-12-07 00:55:36 +00:00
Enji Cooper e2f6f088b5 MFC r304797,r305467,r305468,r305483:
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.

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.

r305483:

Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)

Pointyhat to:	ngie
2016-12-03 02:55:19 +00:00
Hiren Panchasara ca0435e131 MFC r302474 (By gnn)
On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Sponsored by:	    Limelight Networks
2016-11-15 22:18:52 +00:00
Enji Cooper 49530f1e1c MFC r305963,r305970:
r305963:

Reindent TESTSDIR definition for consistency/readability

r305970:

Remove change accidentally committed via r305963 for upcoming tests/sys/fs/...
work
2016-10-21 08:38:18 +00:00
Enji Cooper 4e15733b83 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
2016-10-21 08:22:39 +00:00
Jilles Tjoelker be016b0c81 MFC r305676: 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
2016-10-10 20:24:32 +00:00
Konstantin Belousov 7e6f69fa3f MFC r306588:
Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.
2016-10-09 12:34:56 +00:00