Commit Graph

3637 Commits

Author SHA1 Message Date
kre aa6bc89002 Add several sub-tests to the test for the "eval" builtin,
including testing correct handling of error cases.
One of these new tests located a bug which will be fixed
within minutes of this commit ...

While doing this, move the test that was used only in the
echo builtin test case (testing if the NetBSD shell was being
tested) into a utility function, and also call it in the eval
test, so NetBSD specific behaviour of what is unspecified in
the standard can be checked to ensure it is not accidentally
altered.
2019-01-09 10:51:23 +00:00
christos f629fca860 This now works too. 2019-01-08 00:22:11 +00:00
christos 82a6fadf05 this now works... 2019-01-08 00:21:19 +00:00
thorpej 9e7dc06b6e Fix a silly bug the "cancel thrash" test: the exit condition for the
job was never set, and so if the job actually got started before the
cancellation request came in, it would never finish and the cancellation
request would just hang forever.

Should address a spurious automated test failure reported by kre@.
2019-01-04 05:35:24 +00:00
thorpej 032c1d01a1 Add a test case that exercises repeated sceduling and cancelling of a job,
with periodic dropping of the interlock.
2018-12-28 19:54:36 +00:00
thorpej 3cc63623bb kre@ notified me that the kernel/t_threadpool "rapid" test was occasionally
tripping a KASSERT() failure in the i386-qemu test rig.  It turns out this
is due to "rapid" simply being a buggy test that makes assumptions that
aren't always true, especially on slower / uniprocesor hardware.  So, the
right thing to do is just remove the test.
2018-12-28 16:01:53 +00:00
christos 20ef3dc45b Add an initfini_array test that does not depend on the linker putting it
there automatically.
2018-12-27 19:33:52 +00:00
maxv 38b2a665bf Several improvements and fixes:
* Change the Assist API. Rather than passing callbacks in each call, the
   callbacks are now registered beforehand. Then change the I/O Assist to
   fetch MMIO data via the Mem callback. This allows a guest to perform an
   I/O string operation on a memory that is itself an MMIO.

 * Introduce two new functions internal to libnvmm, read_guest_memory and
   write_guest_memory. They can handle mapped memory, MMIO memory and
   cross-page transactions.

 * Allow nvmm_gva_to_gpa and nvmm_gpa_to_hva to take non-page-aligned
   addresses. This simplifies a lot of things.

 * Support the MOVS instruction, and add a test for it. This instruction
   is special, in that it takes two implicit memory operands. In
   particular, it means that the two buffers can both be in MMIO memory,
   and we handle this case.

 * Fix gross copy-pasto in nvmm_hva_unmap. Also fix a few things here and
   there.
2018-12-27 07:22:31 +00:00
thorpej ad5e13cec6 Fix spurios whitespace (thank you substandard vi clones). 2018-12-26 22:21:10 +00:00
thorpej fd47102229 - De-opaque'ify struct threadpool_job.
- De-_t'ify all of the structure types.

No functional chage, no ABI change (verified with old rump unit test
before and after new librump.so).

Per Taylor's request.
2018-12-26 18:54:19 +00:00
thorpej 87d5cea604 Add -lrump after -lkernspace, because kernspace.a references symbols
from librump and hooray for static linking semantics.

Fixes sun2 build issue reported by kre@.

(XXX WTF did this only start failing after the addition of t_threadpool?)
2018-12-26 14:27:23 +00:00
knakahara 5eb3109a16 Add ATF for ipsecif(4) which connect to two peers in the same NAPT. 2018-12-26 08:59:41 +00:00
thorpej 41d71c6b2c Include some non-critical-but-still-for-correctness lines of code
in the cancellation unit test.  (I could have sworn I actually typed
these lines, no really...)
2018-12-25 21:26:31 +00:00
knakahara 99baf67288 Add ATF for NAT-T enabled ipsecif(4). 2018-12-25 03:54:44 +00:00
knakahara c037dbb205 reduce debug messages when $DEBUG is not true. 2018-12-25 03:28:29 +00:00
thorpej 77118773d1 Add rump-based test cases for threadpool(9). 2018-12-24 21:42:05 +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
kre 3e31d0bb60 Keep infrastructure setup and only exclude test for non-amd64 case.
Should be final nail in coffin of non-amd64 build failures (ie: Atffile
should get installed where it belongs rather than the root dir).
2018-12-24 05:06:45 +00:00
jakllsch 84cd64698f further build fixes 2018-12-23 16:40:15 +00:00
martin 84df641459 Fix the build 2018-12-23 16:23:24 +00:00
maxv 9159f72fc2 Add initial tests for libnvmm's Mem Assist, with 8 test cases. 2018-12-23 13:35:02 +00:00
dholland 519883bde6 Update error string 2018-12-18 08:39:03 +00:00
fox a85205fc7c Fixed the build failures caused by incompatible type comparisons.
Reviewed by <cherry>
2018-12-18 07:11:35 +00:00
dholland 6d6b8495d8 Update error string 2018-12-16 17:08:19 +00:00
hannken 61e6e59852 Have to hijack sysctl() and modctl() for zfs commands.
Should fix PR kern/53422
2018-12-16 14:04:14 +00:00
sevan f4e8600edf port-macppc/46319 is marked as resolved now.
Test on 8.99.26 build of NetBSD/macppc
2018-12-16 02:18:01 +00:00
kre e1be630664 Add a new test case for NetBSD specific readonly tests.
Add more sub-tests to the export_nbsd test case.
In both cases the new -q and -p VAR options are tested.
2018-12-12 11:52:05 +00:00
kre 6f3da39516 Add more subtests to the export and readonly built-in commands test cases.
In particular, add a readonly test to detect the bug that was just fixed...
(but there is more than that one added here).

Also, allow zsh to run more of these tests than it did, what is a builtin
command most places (including in POSIX) can be a reserved word in zsh!
2018-12-12 08:10:39 +00:00
ozaki-r 24e4ff1961 tests: add missing $af 2018-12-11 03:47:51 +00:00
ozaki-r 60afc5cb5b tests: check error messages strictly 2018-12-07 09:29:01 +00:00
ozaki-r fba119d2aa tests: reduce repeated phrases... (NFC) 2018-12-07 09:28:31 +00:00
kre 4474c9f596 Oops, this is 2018, not 2017 ... cut&paste (affects just copyright notice) 2018-12-05 02:48:04 +00:00
kre d8b51c8ab7 Add a new test program to test the "intermediate" shell built in
utilities.  That is, not the low level ones that look like syntax,
but aren't: break/continue/return; not those which are really
just external programs that are built in for efficiency (printf,
test, and kill - though kill really needs to be built in) - those
should all have separate test programs (there is a test here for the
built-in echo, as that is an entirely different thing to /bin/echo);
and also not those for which there are other tests because of the
nature of the built-in (like exit, wait, shift, ...).   Lastly not
"times" either as that just seems to be too hard to test rationally.

There is a test (well, framework) for ulimit and there's also t_ulimit.sh
one of those should go, but I am not yet sure which is the best way
to reconcile things.

Note: many (in fact) most of the test cases added here are either
entirely empty (no tests at all, beyond testing that the built-in is
in fact a shell built-in) or only very rudimentary tests - assistance
in fleshing those out would be welcome (the boilerplate is all here,
all that is needed is some actual tests to run...)
2018-12-05 02:45:05 +00:00
kre 62d35c4e21 Supply a missing \ ... this missing has meant that these tests
have not been testing everything they should have been testing.
Never mind, they still all succeed.
2018-12-04 09:47:25 +00:00
blymn d10c3fbbc9 Fix failing background test check file. 2018-12-04 09:32:50 +00:00
hannken 1c0c955e08 Skip zfs, it does not GOP_ALLOC.
PR kern/47656 test zfs_fillfs.
2018-11-30 09:52:39 +00:00
blymn d70ea1b172 Add script for assisting with debugging curses tests. 2018-11-30 04:57:02 +00:00
christos 90de07325c Add base-256 test (Micha Gorny) 2018-11-30 00:53:41 +00:00
hannken 6ac427e315 Redo the access check for setting va_flags in zfs_netbsd_setattr().
Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.

PR kern/47656 test zfs_flags.
2018-11-28 10:01:28 +00:00
hannken e4ec60fc8e Add missing access check for REMOVE into zfs_netbsd_lookup().
PR kern/47656 test zfs_dirperms.
2018-11-28 09:58:58 +00:00
hannken 5cbc5ce853 Add missing access check for setting va_Xtime into zfs_netbsd_setattr().
PR kern/47656 test zfs_times.
2018-11-28 09:57:59 +00:00
kre 9addc4465a Add two new test cases to add more tests for $@ expansions
(and a few more subtests in an existing test case).

The two new test cases currently fail, because of issues with
expanding "${1+$@}" which will (hopefully) be fixed soon.
(This looks to have been broken sometime during 2013 ... then I
made it even worse with some of the parser changes a while ago,
though the end result is that it appears less broken than it
really is.)
2018-11-27 09:59:30 +00:00
kre 7751e46b63 Add a new test case to test <> (open for input & output),
includion a test to make sure that the file doesn't get truncated.

Add new subtests to the "incorrect redirections" test case, to
validate correct behaviour of the shell when redirections fail in
various scenarios, including when the redirect is the whole command.

More along these lines are really needed, but this is better than nothing.

All the added tests pass on the /bin/sh currently in netbsd HEAD.
2018-11-27 09:55:32 +00:00
knakahara d1268e2e86 Add ATF for IPv6 NAT-T.
We use IPv6 NAT-T to avoid IPsec slowing down caused by dropping ESP packets
by some Customer Premises Equipments (CPE). I implement ATF to test such
situation.

I think it can also work with nat66, but I have not tested to the fine details.
2018-11-22 04:51:41 +00:00
kre fa836fad8c It turns out there are more cases where escaping of meta-chars
was not being done properly (too many different code paths inside sh)
so add even more subtests to the case_matching test case to verify
that all (that I can think of for now anyway) get fixed when this
gets cleaned up.   The case_matching test case still fails, but now
6 of its subtests should fail (until sh is corrected ... soon).
2018-11-18 13:41:24 +00:00
kre 0ebdf0f8fc Add some tests to detect the presence of a bug in sh reported by
Martijn Dekker (private e-mail.)   Variable expansions that are
double quoted result in literal characters (nver pattern matching
meta chars.)  This includes '\' (that one was the bug.)
[On the other hand, a variable in a case pattern expansion that is
unquoted, produces a pattern, and in that the \ character can be
used to excape other pattern meta-chars (and itself.]

This addition will cause the case_matching test case to fail (two
of the newly added sub-tests fail) until fixes to /bin/sh are made.
(That is comiung soon, the code exists already.)
2018-11-18 01:24:44 +00:00
riastradh 191d101a58 cbrtl_powl is xfail only if long double has more bits than double. 2018-11-15 05:14:20 +00:00
knakahara 3d0c03bef5 let ATF detect a bug fixed by if_vla.c:r1.132. 2018-11-14 05:07:48 +00:00
kre 0b70db4e58 Add a test for the bug in PR bin/53712 ( " { } > out " core dump )
Tested with both fixed, and unfixed, versions of /bin/sh (and in
posix mode, where that is a syntax error).
2018-11-14 02:37:51 +00:00
riastradh ae35b062b5 Make fenv.h optional for this test to unbreak the vax build. 2018-11-12 05:02:00 +00:00