Commit Graph

3930 Commits

Author SHA1 Message Date
maxv
c496a7b118 Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.

Part of PR/54611.
2019-10-14 10:39:24 +00:00
jhigh
3f4bc82592 removed incorrectly added file 2019-10-14 06:40:40 +00:00
jhigh
499c4e53b1 adding argon2 tests 2019-10-14 03:47:19 +00:00
christos
85f5895969 add missing initializer 2019-10-14 01:15:32 +00:00
maxv
416eaf02dc Fix incorrect parsing: the R/M field uses a special GPR map when the
address size is 16 bits, regardless of the actual operating mode. With
this special map there can be two registers referenced at once, and
also disp16-only.

Implement this special behavior, and add associated tests. While here
simplify a few things.

With this in place, the Windows 95 installer initializes correctly.

Part of PR/54611.
2019-10-13 17:32:15 +00:00
kamil
bec2cbec70 Fix race in t_ptrace_wait* LWP tests
Increment the done variable under a mutex. This variable was updated
non-atomically and sometimes not reaching the expected treshold.
2019-10-13 09:42:15 +00:00
mrg
4e545ef793 ifr_name is nul terminated. make it so. 2019-10-13 07:46:16 +00:00
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
kamil
1f5d3e8c5d Enable TEST_LWP_ENABLED in t_ptrace_wait*
The LWP events (created, exited) are now reliable in my local tests.

PR kern/51420
PR kern/51995
2019-10-13 04:05:39 +00:00
kamil
5a3fb2eb52 Bump the number of threads in LWP t_ptrace_wait*() tests from to 100
This is a torture, but on purpose to catch LWP_CREATED and LWP_EXITED bugs.
The threads do nothing other than calling sched_yield() in a loop.

MAXLWP is now defined to 2048 on all ports.

This change effects the following tests:

 - trace_thread_nolwpevents
 - trace_thread_lwpexit
 - trace_thread_lwpcreate
 - trace_thread_lwpcreate_and_exit
2019-10-13 04:00:12 +00:00
mrg
ad0c4b353e use memcpy() for non C-strings. 2019-10-06 01:05:36 +00:00
mrg
662908cac2 sprintf->snprintf 2019-10-05 22:06:29 +00:00
christos
6b7001662d Add tests for escape sequences. 2019-10-05 20:24:16 +00:00
jhigh
c7ab523edc adding full scheme comparison to libcrypt:crypt and pwhash tests 2019-10-05 18:06:16 +00:00
mrg
a83f6c1317 msg:
avoid passing the same pointer in multiple arguments for restrict
marked arguments:
- sigaction() wants separate in/out
- use memmove() not memcpy() for overlapping regions (this may fix
  a real bug in nvi -- but it seems unlikely)
- select() wants separate read/write/except
- sigprocmask() wants separate set/oset
2019-10-04 09:01:59 +00:00
kamil
081796c351 Remove ATF t_ptrace_wait test suspend1
The tests verifies that a thread can be suspended by a debugger and later
resumed by a tracee.

This is an unwanted behavior and will be fixed soon.
2019-10-02 23:15:09 +00:00
kamil
1f257ef9aa Merge PT_GET_PROCESS_STATE checks into traceme_raise ATF ptrace tests
Assert that PT_GET_PROCESS_STATE for !child and !lwp events returns
non-error and zeroed struct ptrace_state.

These checks are not really special to traceme_raise, it's just an
opportunity to reuse them in an existing tests without writing a dedicated
one.

This behavior is needed to maintain in 3rd party software (GDB).
2019-10-01 22:26:38 +00:00
kamil
b0c977dcb4 Add a few static asserts in t_ptrace_wait.c for conditions that must be kept
Assert that ptrace_state and siginfo_t's _ptrace_state are synchronized.
2019-10-01 21:13:30 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
christos
38a0431bfa Restore binary compatibility by using the statvfs90 structure internally. 2019-09-23 12:00:57 +00:00
kre
f77bb6aeed Initialise the sometvs array of struct timeval that is to be used to
validate that utimes() cannot update the times of a file on a read only
filesystem.   The values are never actually used, but since
	src/sys/kern/vfs_syscalls.c 1.535
they are validated for sanity, and the syscall returns EINVAL if the
values passed are invalid (tv_usec <0 or >= 1000000).  If that happens
we don't get as far as the test which produces the EROFS that is expected
from this test (these tests - one for each filesystem type).

So, init the timeval structs (just to 0, the values will still not be
used) so that the EINVAL doesn't bite us before we're eaten by the EROFS
which is the way we're supposed to die.

If the syscall API args were labelled as "const" the compiler probably
would have caught the use of uninit'd vars and complained much sooner.
2019-09-21 14:25:42 +00:00
blymn
e275f7f7db Rototill to add complex character support:
- Add cchar command to director test language to allow a complex character
  to be defined and passed to the slave.
- Removed the distinction between args and returns internally to prevent
  confusing the two which leads to errors and/or crashes.
- Converted mutt_test to use the new cchar definition and fixed the
  check files for the test.
2019-09-19 11:31:57 +00:00
christos
3f24065918 Remove the incomplete define. 2019-09-15 23:39:13 +00:00
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
roy
801b070c3c t_arp: Wait for 10 seconds for RTM_MISS
Let's try increasing the ping timeout to try and fix PR misc/54525.
2019-09-09 10:29:04 +00:00
roy
07f3df8b72 tests: fix ARP and NDP tests for RTM_* messages
While here add tests for RTM_MISS.
2019-09-03 19:07:50 +00:00
brad
01424baa92 The cleaner is compiled into the ATF test harness for the LFS
filesystem tests.  Use the new -J option to pass the raw device into
the cleaner.  This avoids the not rump safe getdiskrawname call and
makes sure we use an internal rump device name for cleaning.  This
should fix bin/54488.
2019-08-30 23:45:13 +00:00
kamil
1a5f018b01 Enhance the support of LLVM sanitizers
Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
2019-08-27 22:48:53 +00:00
ozaki-r
b5415e57cd tests: add tests for IPv6 link-local addresses with a scope ID
Setting an address with a scope ID doesn't work for rump.ifconfig for some
reasons and needs $HIJACKING for now.  The bug should be fixed someday.
2019-08-26 07:41:50 +00:00
ozaki-r
c6ad1822be tests: explain how rump_server_check_memleaks works 2019-08-26 04:50:32 +00:00
ozaki-r
06b680af2f tests: restore rump_server_check_poolleaks for llentpl
It didn't work correctly because rumphijack for vmstat didn't work expectedly;
vmstat has the sgid bit for kvm(3) and that prevents rumphijack from working.

Address the issue by cloning a vmstat binary without the sgid bit temporarily
and using it for rumphijack.  Note that it's a workaround.  vmstat should stop
using kvm(3) for /dev/kmem and drop the sgid bit eventually.
2019-08-26 04:50:03 +00:00
kamil
5612f2cac8 Define target_not_supported_body() in TSan, MSan and libFuzzer tests 2019-08-23 06:39:54 +00:00
ozaki-r
571560e45c Disable rump_server_check_memleaks for now
It doesn't work in some cases.
2019-08-20 09:53:45 +00:00
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