Commit Graph

63 Commits

Author SHA1 Message Date
christos 7d2cda35f1 Add tests for fexecve(2) 2019-09-15 16:53:58 +00:00
christos 0a76d2ed5a Add F_GETPATH, presented to tech-kern. 2019-09-15 16:25:57 +00:00
kamil 8d8be769a2 Adapt tests/kernel/t_subr_prf for MKSANITIZER
Allow to rename snprintf-like functions to avoid clashes with a sanitizer.

This tests needs a fixup to remove 'undef symbol' from the test code
generator.
2019-08-15 08:46:09 +00:00
christos da8b7648ed Add a $ORIGIN test 2019-06-07 21:18:16 +00:00
kamil 707a3080aa Add ATF KERN_PROC_CWD tests 2019-06-01 19:49:02 +00:00
mrg 5bb852d0c6 - tests explicitly check failure modes, ignore those warnings 2019-02-04 05:24:18 +00:00
thorpej 68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
christos 78928445f5 PR/53908: Alex Raschi: Test that require modules belong in modules; move the
threadpool test from kernel to modules.
2019-01-25 18:33:58 +00:00
thorpej 2834fa0ab4 Add threadpool(9), an abstraction that provides shared pools of kernel
threads running at specific priorities, with support for unbound pools
and per-cpu pools.

Written by riastradh@, and based on the May 2014 draft, with a few changes
by me:
- Working on the assumption that a relative few priorities will actually
  be used, reduce the memory footprint by using linked lists, rather than
  2 large (and mostly empty) tables.  The performance impact is essentially
  nil, since these lists are consulted only when pools are created (and
  destroyed, for DIAGNOSTIC checks), and the lists will have at most 225
  entries.
- Make threadpool job object, which the caller must allocate storage for,
  really opaque.
- Use typedefs for the threadpool types, to reduce the verbosity of the
  API somewhat.
- Fix a bunch of pool / worker thread / job object lifecycle bugs.

Also include an ATF unit test, written by me, that exercises the basics
of the API by loading a kernel module that exposes several sysctls that
allow the ATF test script to create and destroy threadpools, schedule a
basic job, and verify that it ran.

And thus NetBSD 8.99.29 has arrived.
2018-12-24 16:58:53 +00:00
riastradh a31ad98a39 Use feenableexcept to trap fp exceptions, and trigger one, for SIGFPE.
Not every CPU traps integer division by zero -- aarch64, powerpc,
&c., just return zero.
2018-11-11 01:26:08 +00:00
kamil ce34db38fd Add new ATF tests: kernel/t_zombie
New tests attempting to kill, stop, drop or revive a zombie:
 - signal1 (SIGKILL)
 - signal2 (SIGSTOP)
 - signal3 (SIGABRT)
 - signal4 (SIGHUP)
 - signal5 (SIGCONT)

New test race1 verifying whether there are any kernel races when processing
signals to zombies, executing in a loop for 5 seconds.

These tests were inspired by a kernel unexpected behavior when a lookup
of a dying process could result in two detected entities once as an alive
process and once as a zombie.

race1 is similar to t_ptrace_wait* race1, however without ptrace(2) involved.

Sponsored by <The NetBSD Foundation>
2018-03-14 02:13:47 +00:00
nakayama 036e3ece76 Use SCRIPTS instead of PROGS to avoid strip(1) if STRIPFLAG=-s. 2017-12-14 14:38:17 +00:00
christos 3fd3ffc3a1 PR/52812: scole_mail: src/tests/kernel/t_timeleft.c doesn't compile with MKRUMP=no
It needs libpthread regardless MKRUMP..
2017-12-12 18:19:45 +00:00
christos f765c47147 Add tests to make sure that the program name is what it is supposed to be. 2017-12-10 15:37:54 +00:00
christos 85bf85b701 make _lwp_park return the remaining time to sleep in the "ts" argument
if it is a relative timestamp, as discussed in tech-kern.
XXX: pullup-8
2017-12-08 01:19:29 +00:00
christos 962d0d23f1 Add trapsignal tests that make sure that traps don't end up spinning
indefinitely, discussed in tech-kern.
2017-12-07 19:46:40 +00:00
christos f2c3026d0a add a test to check that the interpreter is preserved when executing scripts. 2017-12-06 13:54:26 +00:00
kamil 97a670fdb7 Remove tests/kernel/t_ptrace* from the tree
ptrace(2) tests have been moved to tests/lib/libc/sys

Sponsored by <The NetBSD Foundation>
2017-04-03 05:06:28 +00:00
kamil cc4260326d Remove kernel/arch/{amd64,i386,x86} tests
These files were merged with kernel/t_ptrace_wait*

This removes MD test files.

Sponsored by <The NetBSD Foundation>
2017-04-02 01:49:51 +00:00
kamil 15bac0f54a Define -D_KERNTYPES in CPPFLAGS unconditionally to fix MKRUMP=no build
Reported by Robert Swindells

Sponsored by <The NetBSD Foundation>
2016-12-14 06:19:59 +00:00
kamil 96cf2030eb Refactor location of amd64-specific ATF tests to new dir kernel/arch/amd64
Rename
 - tests/kernel/t_ptrace_amd64_wait.c
to
 - tests/kernel/arch/amd64/t_ptrace_wait.c
and adapt appropriate files accordingly.

New directory will be used for more amd64-specific tests, verifying the
MD parts of the kernel.

Remove old entries from distrib/sets/lists as they were added a while ago.

Sponsored by <The NetBSD Foundation>
2016-12-02 05:54:14 +00:00
kamil 6df343d465 Add new test file t_ptrace_amd64_wait.c and refactor t_ptrace_*wait* tests
Clone t_ptrace_wait.c to t_ptrace_amd64_wait.c and put common parts to
t_ptrace_wait.h.

The t_ptrace_amd64_wait.c file is dedicated to hold amd64-specific tests
for the ptrace(2) interface.

Add new basic test dbreg1 in t_ptrace_amd64_wait{,3,4,6,id,pid}:
    Verify plain PT_GETDBREGS with printing Debug Registers

Fix evbarm64-aarch64 issue pointed by <christos>, kill1 and kill2 tests
must be defined without PT_STEP guards.

Sponsored by <The NetBSD Foundation>
2016-12-01 20:11:17 +00:00
kamil 5cc56ca0a8 Add new tests for combination of wait(2) interfaces with ptrace(2)
Move out wait(2) specific tests from t_ptrace and put them to t_ptrace_wait

Add generic code fragments to reuse the same source-code for every member
of the wait(2) family, namely:
 - wait(2)
 - waitpid(2)
 - waitid(2)
 - wait3(2)
 - wait4(2)
 - wait6(2)

Currently in the new test-suite there are the following tests:
 - traceme1
 - traceme2
 - traceme3
 - traceme4
 - attach1

Not all tests are possible to be executed against every wait(2)-like
interface, therefore they will be disabled in such case. Currently this
limits attach1 to waitpid(2), waitid(2), wait4(2), wait6(2), while the
other tests (traceme 1-4) run with all of the interfaces.

The construct of this file is dedicated for addition of new tests in the
close future.

As of now all of the tests pass correctly.

Thanks for Robert Elz for suggestions on improving the code (earlier draft
of this new form).

Sponsored by <The NetBSD Foundation>.
2016-11-07 21:09:03 +00:00
kamil 46910e0e26 Add new test t_ptrace with traceme1
This test is a placeholder for further checks of the native ptrace(2)
function calls.

XXX: Is it safe to call ATF functions from a child? FreeBSD seems to
     construct dedicated asserts for them.

XXX: printf(3) calls from a child are not intercepted by atf-run(1)

Sponsored by <The NetBSD Foundation>.
2016-11-02 12:51:22 +00:00
christos cfb3849454 This needs _KERNTYPES on some platforms. 2016-02-15 14:59:38 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
matt b9e582e94c Don't build tests that depend on RUMP if BSD_MK_COMPAT_FILE is defined. 2015-06-22 00:05:23 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
gson 643acb6d0e Test that reading a CTLTYPE_INT sysctl variable into a buffer that is
too small returns ENOMEM, and that reading it into a buffer that is
large enough returns the expected sizeof(int) bytes of data.
2014-08-09 07:04:03 +00:00
he f693807fd8 Fix static linking for the tests: -lrump is also used by -lrumpuser,
so we also need -lrump after -lrumpuser.  Fixes build for sun2.
2014-06-10 04:28:39 +00:00
mlelstv 86479a1389 First attempt at stress testing umount of a busy disk. 2013-04-16 22:05:44 +00:00
martin f368c7a2de Add a testprogram for PR 47598. 2013-02-28 15:31:22 +00:00
pgoyette 8b483e6488 Add missing '+' so we include t_lock as well as t_lockf and others.
Should fix the build break.
2012-11-07 16:36:49 +00:00
pgoyette 7206730159 Add ATF version of the file locking test 2012-11-07 14:00:38 +00:00
nakayama b826e4d970 Fix MKRUMP=no build.
librt is unrelated to rump.
2012-11-07 05:13:45 +00:00
pgoyette c168fbbf95 Convert to ATF format the old src/regress/ style tests for Sys V IPC 2012-11-05 04:09:14 +00:00
pgoyette 938a6ff547 Convert the old src/regress/mqueue test to ATF 2012-11-03 05:19:33 +00:00
christos cb461c6808 Exclude tests that use rump 2012-08-08 13:57:05 +00:00
jruoho 0a082b37fe Move the _lwp_ctl(2) preemption counter check to the right place. 2012-03-17 17:23:34 +00:00
martin 0ce98f42a7 Move posix_spawn tests to lib/libc/gen/posix_spawn - they test both libc
and kernel, but that is an implementation detail unrelated to the tests
themselfs.
Ok: releng
2012-02-13 21:03:06 +00:00
martin 19f52532ad Add userland part of posix_spawn. Libc functions imported from FreeBSD.
Based on Charles Zhang's summer of code project.
2012-02-11 23:31:22 +00:00
christos 408524dea5 Add a test for the kernel snprintf. 2011-11-24 01:46:40 +00:00
jruoho d79436d44f Move the sigaction(2) test to the right place. 2011-10-15 07:00:48 +00:00
jruoho d7cfdec1a4 Move the ucontext(2) test to the right place. 2011-10-15 06:54:52 +00:00
jruoho e6064fc127 Move the writev(2) test to the right place. 2011-10-15 06:50:52 +00:00
jruoho 2a39986da0 Move the clock_gettime(2) timer test to the right place. 2011-10-15 06:42:16 +00:00
jruoho 175ae78538 Follow the design principles of tests(7) by merging 't_poll3w' to 't_poll'
as a test case instead of separate file.
2011-10-15 06:33:45 +00:00
jruoho 04c8b02c8d Move the mkdir(2) test to the right place. 2011-10-15 06:26:33 +00:00
jruoho 599acddbd9 Move the pipe(2) test to the right place. 2011-10-15 06:17:02 +00:00
jruoho 45e23a6a46 Move the posix_fadvise(2) test to the right place. 2011-10-15 06:10:26 +00:00