Commit Graph

3946 Commits

Author SHA1 Message Date
ozaki-r
7c447e107e tests: check pool object leaks
Currently only llentpl leaks can be detected.
2019-08-19 03:22:47 +00:00
ozaki-r
ce0ae1dfed tests: use rump_server_add_iface to create interfaces 2019-08-19 03:22:05 +00:00
ozaki-r
b271a6e258 tests: enable to create interfaces other than shmif with rump_server_add_iface
For this change interfaces are destroyed in the reverse order of their
creations in case there are dependencies between interfaces.
2019-08-19 03:21:13 +00:00
ozaki-r
3a470f73b4 tests: fix test header name 2019-08-19 03:20:27 +00:00
kamil
f0720e6929 Add ATF c and c++ tests for TSan, MSan, libFuzzer
These tests require Clang/LLVM 7 or newer on NetBSD.

Contributed by Yang Zheng during GSoC 2018.
2019-08-18 20:15:58 +00:00
gson
40aea22397 The udf_renamerace test case no longer fails due to PR kern/49046, but
it does fail due to PR kern/53865 on real hardware.
2019-08-17 09:44:01 +00:00
kamil
d383d9b590 Avoid symbol clashes in test/rump/modautoload/t_modautoload with sanitizers
Set SANITIZER_RENAME_SYMBOL.t_modautoload to:

 * sysctlbyname
 * sysctlgetmibinfo
2019-08-17 04:04:28 +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
kamil
fab4b3f46f Avoid symbol clashes in bin/df under MKSANITIZER
Remove symbol conflicts for: __getmntinfo13
2019-08-15 08:24:11 +00:00
kamil
5d3c833b7d Avoid symbol clashes in fs/nfs/nfsservice under MKSANITIZER
Remove symbol conflicts for: __getmntinfo13
2019-08-15 08:23:45 +00:00
kamil
825c3698b4 Avoid symbol clashes in tests/usr.bin/id under MKSANITIZER
Remove symbol conflicts for:

 - __getpwnam50
 - __getpwuid50
 - getgrgid
 - getgrouplist
 - getgroups
2019-08-15 08:22:52 +00:00
kamil
1101023c0c Fix build of t_ubsan/t_ubsanxx under MKSANITIZER
Do not link micro-ubsan runtime for disabled tests.

This avoids double symbols linked into a single binary.
2019-08-15 08:17:32 +00:00
ozaki-r
bce11250f5 tests: check if ifconfig (ioctl) works after a failure of ifconfig destroy
This is a test for PR kern/54434.
2019-08-15 04:21:33 +00:00
ozaki-r
caa310059a Make a permanet neighbor cache to avoid sending an NS packet disturbing the test
A receiver of an ICMPv6 request packet creates a stale cache entry and it turns
into the delay state on replying the packet.  After 5 second, the receiver sends
an NS packet as a reachability confirmation, which disturbs the test and causes
a unexpected result.

Should fix PR misc/54451
2019-08-13 07:20:43 +00:00
martin
7f7ec27799 Re-enable the QEMU specific timing limits, but only an increased upper
limit for now - let's see if that works on the test-bed.
2019-08-11 11:42:23 +00:00
martin
98d251c113 PR lib/54440: adapt the FreeBSD change to this test and calculate time
differences more exact, allowing between 0 and 1 s delay between the
expected wakeup and the actual event happening.
Also convert the QEMU special case code to the same scheme, but for now
disable it (with XXX mark) and see if the proper timing limits fix that
case too.
If not, we will re-enable the QEMU special case.
2019-08-10 07:36:15 +00:00
christos
92bbbea0b3 PR/54414: Valery Ushakov: add a test for wcsrtombs(3) doesn't update the
source argument on conversion error
2019-07-28 13:46:45 +00:00
ozaki-r
ac002ee323 tests: add tests for getspi and udpate 2019-07-23 04:31:25 +00:00
kre
311f349816 Stop assuming that printf handles options in any way at all
(it doesn't - that is, shouldn't) which includes processing -- as an
"end of options".  The first arg is (always) the format string.

Remove/fix tests that assumed the contrary.

Problem (with printf) pointed out on tech-userlevel by Thierry Laronde.
2019-07-21 15:25:59 +00:00
kre
da8bc57f2b Correct a typo. It is atf_require_prog not atf_require_pfog ... 2019-07-21 15:00:18 +00:00
ozaki-r
2f33341a03 tests: extract all kernel logs, not just a panic message, from rump_server.core 2019-07-18 04:22:22 +00:00
ozaki-r
bc1d718ff0 tests: shorten the expire time of neighbor caches to reduce the runtime of the tests 2019-07-18 04:00:09 +00:00
christos
fbf9c51ff3 fix misplaced paren 2019-07-16 21:13:28 +00:00
martin
653f037ebe PR misc/54382: whenever open(2) is called with O_CREAT, make sure to
pass an open mode argument.
2019-07-16 17:29:17 +00:00
gson
b9a5a0bbdb In the setitimer_old test case, allow for time passing between the two
setitimer() calls.  Should fix PR kern/54370.
2019-07-13 12:44:02 +00:00
msaitoh
03e9d50adf Fix typo (s/supress/suppress/). 2019-07-11 03:49:51 +00:00
martin
0509bcf964 Gracefully skip test if not enough space in temporary directory. 2019-07-10 06:21:40 +00:00
martin
33a5a5b239 Reduce disk image size for tests (PR 44239 has been fixed) 2019-07-10 06:10:54 +00:00
martin
d903b87a2d Make sure we have enough free inodes before running the filename_expansion
test.
2019-07-10 05:57:43 +00:00
maya
36592171e1 return return atf_no_error() instead of 0 for consistency.
suggested by moritzbuhl in https://github.com/NetBSD/src/pull/11/
2019-07-09 16:24:01 +00:00
gson
7753bf0b70 Update require.memory to match the increased rlimit. 2019-07-09 13:59:25 +00:00
ozaki-r
a96cce565c tests: check that a new cache is not created over the limit 2019-07-09 02:50:24 +00:00
ozaki-r
24bc91d9f1 Add ATF test for a description.
From t-kusaba@IIJ
2019-07-04 02:46:40 +00:00
kamil
c4f0499ad5 Avoid GCC warning on NetBSD/i386
Cast note_hdr.n_namesz to ssize_t through size_t to avoid potential
signedness bit shifts.
2019-07-01 02:04:37 +00:00
blymn
f3430e9b6f Fix test for pad and enable it. 2019-06-30 22:37:11 +00:00
blymn
afb56d5385 Enable mvscanw test since libcurses is now correct. 2019-06-30 22:21:33 +00:00
mgorny
dba7737605 Add a test for verifying procinfo note inside coredumps.
Add a first test for triggering a core dump in the debugged process
(via PT_DUMPCORE) and verifying it.  The test finds procinfo note
and checks its contents.

The core dump is processed through libelf.  However, it only provides
for finding all note segments (or sections?).  I had to implement
finding and processing individual notes myself.  I've added
a core_find_note() function that will be reused in future tests.

Reviewed by kamil.
2019-06-30 21:20:04 +00:00
ozaki-r
2ed6d11366 tests: test state transitions of neighbor caches 2019-06-28 06:46:04 +00:00
blymn
edb52aabb2 Enable beep test, return is correct. 2019-06-26 22:18:44 +00:00
mgorny
c2ad96ff63 Implement PT_GETXSTATE and PT_SETXSTATE
Introduce two new ptrace() requests: PT_GETXSTATE and PT_SETXSTATE,
that provide access to the extended (and extensible) set of FPU
registers on amd64 and i386.  At the moment, this covers AVX (YMM)
and AVX-512 (ZMM, opmask) registers.  It can be easily extended
to cover further register types without breaking backwards
compatibility.

PT_GETXSTATE issues the XSAVE instruction with all kernel-supported
extended components enabled.  The data is copied into 'struct xstate'
(which -- unlike the XSAVE area itself -- has stable format
and offsets).

PT_SETXSTATE issues the XRSTOR instruction to restore the register
values from user-provided 'struct xstate'.  The function replaces only
the specific XSAVE components that are listed in 'xs_rfbm' field,
making it possible to issue partial updates.

Both syscalls take a 'struct iovec' pointer rather than a direct
argument.  This requires the caller to explicitly specify the buffer
size.  As a result, existing code will continue to work correctly
when the structure is extended (performing partial reads/updates).
2019-06-26 12:30:12 +00:00
blymn
6e08cf3636 Fixed mvscanw test but leave disabled for the moment, the return for
mvscanw is incorrect in libcurses, we need a major lib version bump
to correct it.
2019-06-25 22:19:29 +00:00
skrll
b801bf2f56 Another spello of 'unknown' 2019-06-24 06:26:29 +00:00
isaki
e0eeaafc81 Rewrite t_pad test.
Previous version compared the pad's output binary passed mulaw-slinear
conversion and frequency conversion with the prepared "good result".
In such case, a test may fail when the implemantation changes.  In fact,
the frequency conversion algorithm was changed in isaki-audio2, so
output waveforms is not completely the same (but that's no problem with
the audio waveforms).
New version uses slinear_le/2ch/44100Hz input data and compares the
output binary with the input data.  pad with no conversions should
output the same binary.
Fix PR kern/54187.
2019-06-20 12:14:46 +00:00
kamil
177438b064 Add mkfifo{,at}(2) mode in mknod{,at}(2) as requested by POSIX
mknod with mode & S_IFIFO and dev=0 shall behave like mkfifo.

Update the documentation to reflect this state.

Add ATF tests.

This is an in-kernel implementation as typically user-space programs use
mkfifo(2) directly, however whenever there is need to bypass libc (like in
valgrind) then portable POSIX software calls the mknod syscall.

Noted on tech-kern@ by Greg Troxel.
2019-06-20 03:31:53 +00:00
kamil
6923eb2928 Allow to conditionally enable LWP ATF tests in t_ptrace_wait*
By default the tests are disabled.
2019-06-18 21:14:26 +00:00
gson
8d7fd85720 The runtime of the ecdsa test case increased approximately sixfold
with the openssl update on 2019-06-09, and it is now timing out on
sparc.  Increase the timeout by roughly the same factor.
2019-06-16 10:45:50 +00:00
kamil
0937aecd4c Enable vfork(2) ATF tests in t_ptrace_wait*
The racing issues are gone in my local setup.
2019-06-13 20:26:06 +00:00
kamil
3d6a33dc1e Add new ATF ptrace(2) tests for posix_spawn, reusing tests for fork/vfork
New tests:
 - posix_spawn_detach_spawner
 - posix_spawn_kill_spawner
 - posix_spawn_singalmasked
 - posix_spawn_singalignored

All test pass.
2019-06-12 17:07:11 +00:00
kamil
3bdf3dd9d4 Add new PTRACE_POSIX_SPAWN tests in ptrace(3)
Add test:
 - eventmask_preserved_posix_spawn
 - fork9..fork16
 - vfork9..vfork16
 - posix_spawn1..16

New tests verify semantics of PTRACE_POSIX_SPAWN.

All tests pass.
2019-06-11 23:30:05 +00:00
hannken
22d3f49885 Need rumpdev_disk for rumpfs_zfs. 2019-06-11 14:00:16 +00:00
blymn
1c4bb036d6 Fixed bug in curses library keyname, test now passes. 2019-06-11 10:23:36 +00:00
blymn
aa404db794 Bracket strings being validated with markers to ensure sneaky whitespeace
is noticed.
2019-06-11 10:22:35 +00:00
gson
dd9a375876 In the "got %d/%d" message printed at the end of the pingsize test,
make the latter number show the actual number of ICMP packets the test
attempted to send.  Thus, the two numbers can now be meaningfully
compared, and their difference indicates the number of packets lost.
2019-06-11 08:34:01 +00:00
blymn
347a95cdfb Fix dupwin test. 2019-06-11 08:09:35 +00:00
blymn
77b858f20e fix derwin test. 2019-06-11 08:00:38 +00:00
kamil
0b4f3508ae Add posix_spawn(3) ATF tests in t_ptrace_wait*
New tests verify whether forking process reports forking events to a
debugger.

Right now there is no support in the kernel for this system.
2019-06-10 22:16:06 +00:00
kamil
9faafe843f Add more verbosity to debug messages in t_ptrace_wait
Log func() file:line for each debug message.

Most messages are similar one with the other and this change allows easier
navigation in the code.
2019-06-10 21:18:04 +00:00
blymn
1a6faca1b0 Add a script that allows a check file to be created by cutting and
pasting the contents of the square brackets in the "Excess nn bytes
from slave" message emitted when the director is running in verbose
mode (-v).
2019-06-09 07:54:55 +00:00
blymn
94110ecce1 Adjust check files for changes in cursor positioning. 2019-06-09 07:49:42 +00:00
blymn
437fe1c40c Add an extra parameter to the h_run function so flags can be passed
to the director.
2019-06-09 07:48:47 +00:00
maxv
d1002cd7eb Change the NVMM API to reduce data movements. Sent to tech-kern@. 2019-06-08 07:27:44 +00:00
christos
da8b7648ed Add a $ORIGIN test 2019-06-07 21:18:16 +00:00
gson
1430c33c98 Add a regression test for PR bin/54154, or in other words, make sure
we get notified in a timely manner if gdb's XML support disappears
again.
2019-06-07 19:05:15 +00:00
mgorny
d3a3574d75 Fix alignment of SSE filling data 2019-06-04 12:17:42 +00:00
mgorny
e00cc41d74 Add more debug to register writing tests 2019-06-04 12:17:05 +00:00
kamil
173c420d5d Fix a mistake in a test for KERN_PROC_CWD
Emit properly ENOENT scenario in chroot. For some reason the final patch
did not hit the tree.
2019-06-01 22:18:23 +00:00
kamil
707a3080aa Add ATF KERN_PROC_CWD tests 2019-06-01 19:49:02 +00:00
kre
9c62ddd5c1 Deal with fallout from the addition of
KERN_PROC_CWD in sysctl(3)
That is kern.proc.$$.KERN_PROC_CWD (I think - not that it matters here)

The effect is that -lrump now requires -lrumpvfs

This set of changes fixes (I believe) regular dynamic builds,
more might be required for static builds (will be verified soon).
2019-06-01 06:59:17 +00:00
gson
db7bf52ef5 Increase the timeout for the manyaddrs test case; the default is often
insufficient under qemu.
2019-05-31 15:36:10 +00:00
maya
6eb8aac828 Print result of function we tested (sinf),
not of function we didn't test (sin).

no need to print 17 digits for a float.

from Riastradh.
2019-05-27 00:24:37 +00:00
maya
5d16d0ee65 on i386 with FLT_EVAL_METHOD=2, the computation inside cosf was done in
binary80 arithmetic and never rounded to binary32 at the end, so it
appeared farther from the correctly rounded result in binary32 than expected.

Force binary32 using volatile float.

PR lib/54232: lib/libm/t_cos:cosf_angles regression on i386

From Riastradh.
2019-05-27 00:10:36 +00:00
blymn
ae5e88e264 Add more tests for curses 2019-05-26 09:54:32 +00:00
blymn
81750f8bcd Start supporting wide char tests. 2019-05-26 07:47:37 +00:00
blymn
002c700f46 Adjust copywin test to work correctly with updated curses.
This fixes PR 54231
2019-05-26 07:28:14 +00:00
kamil
f3514b55f9 Drop no longer needed macros KCOV_STORE() KCOV_LOAD() in kcov(4)
Corrently KCOV_STORE() and KCOV_LOAD() are equivalent to x=y.

Obtained from <R3x>
2019-05-26 01:44:34 +00:00
kamil
1a993279dc Add new user_va0_disable* tests in t_ptrace_wait*
Add tests:
 - user_va0_disable_pt_continue
 - user_va0_disable_pt_syscall
 - user_va0_disable_pt_detach

Assert that setting PC to 0x0 in PT_CONTINUE/PT_SYSCALL/PT_DETACH for
vm.user_va0_disable==0 is disallowed.
2019-05-25 03:25:08 +00:00
kamil
3978be2006 Add get_user_va0_disable() in t_ptrace_wait.h
Add a utility function to check vm.user_va0_disable.
2019-05-25 03:22:53 +00:00
christos
64bf11ba3e unexpand 2019-05-21 04:10:20 +00:00
christos
38217df340 add printf attribute 2019-05-21 04:09:46 +00:00
kre
8b2a560acf Make the t_subr_prf test build after changes to sys/kern/subr_prf.c
and while here add a simple test for the new kernel vasprintf().
2019-05-21 03:46:45 +00:00
blymn
84da1bf133 Add option to specify an alternate library location to allow testing
a development library version without installing it.
2019-05-19 22:34:23 +00:00
christos
af5402251e Add explanatory text 2019-05-15 13:43:45 +00:00
christos
292b510fe2 clang ifunc's on powerpc require secure-plt. 2019-05-14 19:07:07 +00:00
bad
48e354a3ed Get rid of all the -lrumpdev and -lrumpvfs that are no longer needed
after moving rump's mainbus from rumpdev to rumpkern.

Produces the same atf-run results as before.
2019-05-13 17:55:07 +00:00
blymn
ac3404f424 Provide correct validation after curses change. 2019-05-12 02:37:24 +00:00
maxv
bfb4017486 Rework the machine configuration interface.
Provide three ranges in the conf space: <libnvmm:0-100>, <MI:100-200> and
<MD:200-...>. Remove nvmm_callbacks_register(), and replace it by the conf
op NVMM_MACH_CONF_CALLBACKS, handled by libnvmm. The callbacks are now
per-machine, and the emulators should now do:

-	nvmm_callbacks_register(&cbs);
+	nvmm_machine_configure(&mach, NVMM_MACH_CONF_CALLBACKS, &cbs);

This provides more granularity, for example if the process runs two VMs
and wants different callbacks for each.
2019-05-11 07:31:56 +00:00
mgorny
989594cf4b Add PT_SET*REGS tests for mm/xmm registers. 2019-05-10 18:07:10 +00:00
mgorny
d0d1caee46 Remove obsolete size asserts. 2019-05-10 17:34:26 +00:00
mgorny
d8aacecd69 Use newly-filled i386 reg structs in PT_GETFPREGS & PT_GETXMMREGS tests. 2019-05-10 16:28:00 +00:00
mgorny
2d583f722a Add tests for PT_SETREGS 2019-05-10 16:24:35 +00:00
mgorny
873249d162 Add ptrace() tests for reading mm* and xmm* registers 2019-05-09 13:07:35 +00:00
christos
7ef0a4297e fix unused variable warnings. 2019-05-06 00:08:13 +00:00
mgorny
f07d526de7 Introduce tests for reading r8..r15 registers. 2019-05-05 18:16:39 +00:00
mgorny
e6dd84e00f Reintroduce i386 tests for general-purpose registers, without MMX req
Reintroduce the test for reading i386 general-purpose register values
from the debugged program.  This time it's split into one test for the six
registers not normally used by the compiler (eax..edx, esi, edi), and another
for ebp, esp.  This leaves enough free registers for the latter to work
without MMX.
2019-05-05 18:15:40 +00:00
mgorny
b3185a33be Revert i386_regs_gp_read as it fails on non-MMX systems. 2019-05-05 15:05:22 +00:00
mgorny
15af42397a Add tests for reading pre-set general purpose register values via PT_GETREGS.
Add new tests verifying that PT_GETREGS provides correct register values
from the underlying program.  The test uses inline assembly in the child program
to set registers to well-known constants, then compares the results obtained
via PT_GETREGS against them.

Reviewed by kamil.
2019-05-05 10:04:11 +00:00
kre
b7fc669e75 Fix an (apparent) ancient ash bug, that was apparently fixed sometime
in the past, but managed to re-surface...

The expression "${0+\}}" should expand to "}" not "\}"
Almost all other shells handle it that way (incl FreeBSD & dash).

Issue pointed out by Martijn Dekker.

Add ATF sub-tests for the 4 old var expand operators (${var+word}
${var-word} ${var-word} and ${var?word} - including the forms
with the ':' included) and amongst those tests include test cases
for this issue, so if the bug tries to appear again, we can squash
it quicker.   (The newer pattern matching operators are already
well tested as part of testing patterns.)
2019-05-04 02:52:22 +00:00
kamil
e6d350579a Adapt t_ptrace_wait* tests for recent kernel changes
Adapt AUXV reading loop to handle io.piod_len == 0 as EOF.

Temporarily disable trace_thread_lwpcreate until it will be verified that
it is stable.
2019-05-02 22:52:21 +00:00
kamil
a2a627f040 Rename and partially enable trace_thread ATF ptrace(2) tests
Rename trace_thrad[1234] to more meaningful names:

 - trace_thread_nolwpevents
 - trace_thread_lwpexit
 - trace_thread_lwpcreate
 - trace_thread_lwpcreate_and_exit

In my local tests LWP CREATE events work as expected.
LWP EXIT ones are still racy and keep them disabled racy.

PR kern/51995
2019-05-02 00:34:06 +00:00
kamil
f33e5cf82e ATF ptrace(2) tests suspend1 and resume1 now pass
Verified on bare metal and in qemu.

PR kern/51995
2019-05-01 23:44:16 +00:00