Commit Graph

189 Commits

Author SHA1 Message Date
Enji Cooper
15dbd418f6 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

MFC after:	6 days
Tested with:	make tinderbox
Sponsored by:	Dell EMC Isilon
2017-01-14 20:29:26 +00:00
Enji Cooper
4944940b4e 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

MFC after:	6 days
Tested with:	make tinderbox
Sponsored by:	Dell EMC Isilon
2017-01-14 20:21:21 +00:00
Enji Cooper
00ea8a5fc9 Fix -Wformat issue
Use %zu for printing out results from nitems, as it's size_t based

MFC after:	1 week
X-MFC with:	r312120
Reported by:	gcc (mips:mipsel tinderbox)
Sponsored by:	Dell EMC Isilon
2017-01-14 10:38:39 +00:00
Enji Cooper
dcdb30d8f8 Follow up to r312118
State that execve failed instead of just printing out the program name
and strerror(errno) via err(3).

MFC after:	3 days
X-MFC with:	r312118
Sponsored by:	Dell EMC Isilon
2017-01-14 05:24:35 +00:00
Enji Cooper
f614ceaf4a Fix warnings
- Staticize test_num
- Promote i to size_t to deal with -Wsign-compare issues

Tested with:	clang, gcc, gcc49
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-01-14 05:18:18 +00:00
Enji Cooper
dfa7f3a543 Fix -Wformat issue with zero-length format string passed to err(3)
MFC after:	3 days
Tested with:	clang, gcc 4.2.1, gcc 4.9
Sponsored by:	Dell EMC Isilon
2017-01-14 05:02:53 +00:00
Enji Cooper
bf8f6d7c8d Remove WARNS set globally by ../Makefile.inc now
Sponsored by:	Dell EMC Isilon
2017-01-14 04:20:42 +00:00
Enji Cooper
de81acbd15 Enable WARNS?= 6 across all of tests/sys
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-01-14 04:20:06 +00:00
Enji Cooper
54ff563fb9 Remove unused vars to fix -Wunused issues
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-14 04:10:04 +00:00
Enji Cooper
5fea45956e Fix -Wsign-compare warnings
The loop index (i) doesn't need to be size_t as its comparison is signed

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-01-14 04:09:01 +00:00
Enji Cooper
02820e5e4e Bump WARNS up to 6 again
Has not been tested (can't be after r312103 without cem's hacks
to atf/kyua)!
2017-01-14 04:00:26 +00:00
Conrad Meyer
5c9ce2504a Follow-up to r312103:
Revert r310995 as well.
2017-01-14 02:29:25 +00:00
Conrad Meyer
47f2efe4fb Revert r310994
Don't implement some terrible hack on a test by test basis.  The
framework fix is straightforward and can be chased up in the original
bug.

Reviewed by:	ngie ("be my guest")
2017-01-14 01:03:20 +00:00
Alan Somers
9a1fe327ae 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
2017-01-10 20:35:09 +00:00
Konstantin Belousov
1c32456953 Use type-independent formats for printing nlink_t and ino_t.
Extracted from:	ino64 work by gleb, mckusick
Discussed with:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-06 16:59:33 +00:00
Enji Cooper
e4162b7955 Bump WARNS to 6 to catch simple QA issues like some of the ones I squashed
in r310994
2017-01-01 04:02:06 +00:00
Enji Cooper
7f9785e873 Make sys/vfs/lookup_cap_dotdot actually work with "kyua test"
The tests don't work when reading/writing to file descriptors in the
sandbox after entering capability mode (and wouldn't have, regardless
of the framework), so adjust the tests so they function within the
framework.

For tests that enter capability mode over the course of the test, the
following is now done:

  1. Fork child process for capability mode test.
  2. In child...
     i.   Enter capability mode.
     ii.  Test invariants.
     iii. Exit after calling test function.
  3. Collect status for child and determine whether or not it completed
     successfully.

In order to test the invariants in the child process, they now use assert(3)
instead of ATF_REQUIRE*, as the atf-c-api functions right to results files
in the directories in order to determine where and how tests fail.

While in the area, fix several -Wshadow and -Wunused warnings found when I
bumped WARNS up to 6, and fix some minor style(9) issues with indentation
and type alignment.

PR:	215690
2017-01-01 04:01:27 +00:00
Alan Somers
162ea6dc66 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
2016-12-30 02:22:38 +00:00
Alan Somers
f92ce0224a 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
2016-12-29 20:28:50 +00:00
Jilles Tjoelker
b9a6fb9343 reaper: Make REAPER_KILL_SUBTREE actually work.
MFC after:	2 weeks
2016-12-14 22:49:20 +00:00
Jilles Tjoelker
fe56b17710 Add tests for reaper receiving SIGCHLD (r309886).
PR:		213928
MFC after:	2 weeks
2016-12-12 22:51:29 +00:00
Conrad Meyer
9f0136cb26 Add basic ATF tests for Capability mode .. lookups
A follow-up to r309887.

Several tests copied verbatim from
https://github.com/emaste/snippets/blob/master/test_openat.c .

Reviewed by:	kib@, ngie@ (earlier version)
X-MFC-With:	r309887
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8748
2016-12-12 17:23:09 +00:00
Jilles Tjoelker
b1dd83d1d0 Add some tests for reaper functionality (in procctl()).
MFC after:	1 week
2016-12-10 22:05:24 +00:00
Conrad Meyer
695349e306 coredump_phnum_test: Make expected pheader count more flexible
Note: this test still requires binutils readelf (from ports) to pass, until a
few issues are resolved in elftoolchain.

PR:		215019
Reported by:	ngie@
Sponsored by:	Dell EMC Isilon
2016-12-04 03:50:57 +00:00
Enji Cooper
3d77b88dff 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
2016-12-03 02:24:15 +00:00
Enji Cooper
c68f00edd6 Expect :coredump_phnum to fail
The number of program headers on my system (GENERIC-NODEBUG) don't match the
expected (hardcoded) number in the test

PR:	215019
2016-12-03 02:17:50 +00:00
Enji Cooper
cebf0ec58a Fix test coredump_phnum_test:coredump_phnum require.config specification
The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"',
not `atf_set "require.config" "allow_sysctl_side_effects"'

X-MFC with: r308177
Pointyhat to: cmeyer
2016-12-03 02:09:23 +00:00
Conrad Meyer
e8e39fc29e Add test case for >65535 segment coredumps
A long-belated follow-up to r303099.

With feedback from:	jmmv, ngie
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7264
2016-11-01 19:18:16 +00:00
Ruslan Bukin
0a33140d06 Change fs image name so it will not be regenerated (we
have both big and little-endian images in tree).
Also we don't known the endianness of the platform the
image was generated on.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-10-25 18:43:36 +00:00
Enji Cooper
669c253531 Integrate contrib/netbsd-tests/fs/tmpfs into the FreeBSD test suite
as tests/sys/fs

These testcases exercise tmpfs support

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-10-21 05:24:08 +00:00
Ruslan Bukin
db636d72e3 Add big-endian uzip file system and choose right file system
to proceed tests with.

Reviewed by:	jmmv, ngie
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D8073
2016-10-19 10:01:04 +00:00
Ruslan Bukin
05533a6f19 Fix comment. We have different VM layout on MIPS, so test is skipped.
Requested by:	kib
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-10-18 10:20:58 +00:00
Ruslan Bukin
470d063a87 Skip test on MIPS as we don't have shared page implemented yet.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-10-10 14:21:40 +00:00
Ruslan Bukin
21a4258d89 Ensure data in pipe is available to read.
Useful for latest (5th, direct mode) test only.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-10-10 13:40:05 +00:00
Konstantin Belousov
ddce1c3ddb Export the mq_getfd_np() symbol from librt.so, which allows to get
file descriptor for the given posix mqueue.  Export the
timer_oshandle_np() symbol to get ktimer id for the given posix timer.

Requested by:	Lewis Donzis <lew@perftech.com>
Reviewed by:	jilles
Discussed with:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-10-02 17:02:59 +00:00
Ruslan Bukin
090aa8d18b Increase timeouts for geli tests. It takes 2-3x more time to proceed the
tests on MIPS64EB in QEMU.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-28 08:11:00 +00:00
Ruslan Bukin
d29c555195 Use bsdlabel as we don't have hardlink disklabel -> bsdlabel
on some platforms.

Reviewed by:	ngie
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D7968
2016-09-22 12:53:11 +00:00
Enji Cooper
bddfc749fa Remove change accidentally committed via r305963 for upcoming tests/sys/fs/...
work

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2016-09-19 09:15:12 +00:00
Enji Cooper
34ccb11831 Reindent TESTSDIR definition for consistency/readability
MFC after:		3 days
Sponsored by:		Dell EMC Isilon
2016-09-19 07:07:55 +00:00
Enji Cooper
a85d4fc7e4 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

MFC after:	1 week
X-MFC with:	r305916
Sponsored by:	Dell EMC Isilon
2016-09-18 05:10:15 +00:00
Enji Cooper
9cd2207265 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

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2016-09-18 05:06:15 +00:00
Jilles Tjoelker
d30e66e53a 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
MFC after:	2 weeks
2016-09-09 21:58:48 +00:00
Enji Cooper
8f2b5a5469 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.

MFC after:	58 days
Submitted by:	kib (earlier form)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D6172
2016-09-06 08:50:21 +00:00
Enji Cooper
cb5fe245b1 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.

MFC after:	58 days
Sponsored by:	EMC / Isilon Storage Division
2016-09-06 08:45:29 +00:00
Enji Cooper
3919472360 Skip testcases 9/10 if jail(8) isn't installed
These testcases require jail support

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-09-03 17:59:46 +00:00
Enji Cooper
46f4fe1eb8 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).

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-09-03 17:31:13 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Julio Merino
f2ee07cfdc 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.
2016-08-25 10:28:47 +00:00
Enji Cooper
ef5c8d5460 Only expect :encode_tv_random_million to fail on 64-bit platforms
It passes on i386

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-16 20:32:08 +00:00
Enji Cooper
708cc995e3 Redirect the output of the testcases to stderr instead of
redirecting it to /dev/null

This will aid in debugging failures

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-13 06:26:33 +00:00