Commit Graph

3825 Commits

Author SHA1 Message Date
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
kamil
786ec9cc85 ATF ptrace(2) tests signal9 and signal10 now pass
PR kern/51918
2019-05-01 21:59:32 +00:00
kamil
9cd3398aac Add new fork/vfork ATF trests in t_ptrace_wait*
Add new tests:

 - fork_detach_forker
 - vfork_detach_vforker
 - vfork_detach_vforkerdone
 - fork_kill_forker
 - vfork_kill_vforker
 - vfork_kill_vforkerdone

All tests pass with recent kernel changes.
2019-05-01 18:20:23 +00:00
kamil
514747201b Add new ATF ptrace(2) tests: bytes_transfer_eof
Assert that error is returned after attempt to read or write post EOF.
2019-04-30 22:39:31 +00:00
kre
63e182f423 snprintb(3) says that, in the new(?) Torek format, all fields specs end with \0
The F spec is one of those, it should be terminated with \0 just like all
the others (irrelevant that it has no extra data to delimit).

Fix <sys/mman.h> to define the snprintb() format string correctly (include
the missing \0's).   Fix the copy of that definition included into
snprintb(3) to match the updated mman.h version (ride the date bump
from the day before yesterday .. this is the same change, just corrected).

Undo the previous snprintb.c change ("off by one" fix) which was an
attempt to make the broken mman.h usage work (and did, but not the way
it should be done).   Also, after using the new * format (instead of only
when something has already matched) skip the associated data so we don't
attempt to interpret it as more field specifiers.  This func needs lots of TLC!

Fix the ATF tests for snprintb() to not assume that F format is really
exactly like f format, and has data after the field specifier.  It doesn't.
Add several more tests (including testing the '*' field operator
recently added).
2019-04-29 07:55:38 +00:00
maya
af8d450a9a Use LDADD, which apparently puts the libraries at the end of the command,
and makes static builds (aka sun2) happier.
2019-04-26 20:41:10 +00:00
maya
d7ada1c9e8 -frounding-math is gcc specific, help clang builds 2019-04-26 19:17:05 +00:00
maya
ff9d8a09c1 Add a test case for signbit.
(paranoia prior to a libm change)
2019-04-26 08:52:16 +00:00
blymn
e05fb203f8 Fix argument parsing for mvinsch, last arg is a chtype not a string. 2019-04-26 02:46:00 +00:00
maya
e262cfe2be Expand to cover long double somewhat.
The given data is for double, so use DBL_EPSILON and don't expect better
results.
2019-04-25 22:58:23 +00:00
kamil
aed5e5582f Fix typo in 'exceptions' 2019-04-25 20:48:54 +00:00
kamil
14fc6dc308 Fix typo 2019-04-25 19:37:09 +00:00
kamil
5e8f5be0b4 Introduce check for the support of FPU exceptions
If FPU exceptions are unsupported, skip the SIGFPE crash tests.

Reuse code from tests/kernel/h_segv.c
2019-04-25 19:15:23 +00:00
kamil
977be96776 Do not allow 0 as ILL si_code as it's reserved for SI_USER 2019-04-25 11:47:59 +00:00
kamil
623b6fd526 In ATF t_ptrace_wait* SIGILL tests allow any si_code
These codes are not portable between CPUs and kernels.

Change the checks to return any valid si_code in the defined range of ILL
values.

PR port-sparc/54140 by Andreas Gustafsson
2019-04-25 11:45:12 +00:00
christos
4899735091 PR/54000: Andreag Gustafsson: Compile the rounding test with
-fround-math since with gcc-7, the default mode ignores fenv settings
(the same effect can be achieved with -O0 :-)

https://gcc.gnu.org/wiki/FloatingPointMath
2019-04-24 15:12:09 +00:00
kamil
a9ca1710c0 Add a complete C11 threads(3) implementation
C11 Thread support library is a portable threading C API between OSs,
similar to std::threads in the C++ world.

The library is implemented as a thin shim over POSIX interfaces.

NetBSD implements the API as a part of the POSIX threading library
(libpthread(3)).

C11 threads(3) are in the process of making them an integral part
of the POSIX standard. The interface has been implemented in major
OSs and used with stopgap libraries for older versions of them.

C11 threading library is already used (with a stopgap implementation)
in the NetBSD distribution in MESA.

Original implementation by myself from 2016.

ATF tests are new and cover almost all interfaces.

Proposed on tech-userlevel@.
2019-04-24 11:43:19 +00:00
maya
f93d65267a wether -> whether 2019-04-21 11:45:08 +00:00
kamil
ec2b73a402 Fix typo in TEST_VFORK_ENABLED
This allows building and running vfork(2) test scenarios correctly.
2019-04-19 21:54:32 +00:00
ozaki-r
8a507e3468 tests: dump kernel stats on cleanup 2019-04-18 07:56:54 +00:00
ozaki-r
7a4fe7b5fc tests: make utility funtions easy to use for tests that don't use the framework 2019-04-18 07:56:04 +00:00
kamil
828333c1da Fix Clang/LLVM build in t_ptrace_wait.c
Do not compile functions that might be unused.
2019-04-17 15:54:55 +00:00