Commit Graph

3351 Commits

Author SHA1 Message Date
christos 0b33a75d8f fix usage. 2017-12-08 14:40:45 +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
kre 20fdaa6a50 Update this test to expect the output that is supposed to be produced
by strfmon() rather than the output the old buggy implementation used
to produce.
2017-12-07 22:23:14 +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
kre 38400c3efe Correct a couple of broken test cases:
"%d"  does not take the same args as "%d %s"
	"%%"  does not take the same args as "%llx"
How did these ever survive any kind of even basic sanity check?
2017-12-07 09:37:33 +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 7a515d1c37 Temporarily disable t_ptrace_wait*::resume1 in ATF tests
It hangs forever on releng machines.

Sponsored by <The NetBSD Foundation>
2017-12-04 12:53:46 +00:00
kre e55c81dc8f Since there has been no objection (or even comment) in response
to my message on tech-userlevel ...

    Subject: tests/lib/libpthread/t_mutex:mutex6
    Date: Thu, 23 Nov 2017 17:34:54 +0700
    Message-ID: <28385.1511433294@andromeda.noi.kre.to>

which can be found at:
	http://mail-index.netbsd.org/tech-userlevel/2017/11/23/msg011010.html

which analysed the mutex6 test case of this test, and concluded
that it was useless, nonsense, and broken (the whole test is just a
race - not even really using or testing mutexes), let it be henceforth
forever gone.
2017-12-01 13:25:29 +00:00
kre 3772e94e67 Since the C standard allows for intermediate floating results to contain
more precision bits than the data type expects, but (kind of obviously)
does not allow such values to be stored in memory, expecting the value
returned from strtod() (an intermediate result) to be identical (that is,
equal) to a stored value is incorrect.

So instead go back to checking that the two numbers are very very close.
See comments added to the test for more explanation.
2017-12-01 01:08:35 +00:00
kre 52a978120f Revert 1.4 (perhaps temporarily) and add even more diagnostics to those
added in 1.3 to see if it is possible to determine why the strict equality
test fails on i386, yet succeeds elsewhere.
2017-11-28 23:26:01 +00:00
kre 9fefbad1a9 Make this test somewhat deterministic - far fewer races, and most
of what are left are "race for the bus" type - if we lose, we just
wait for the next one ... slower but still reliable.

There are two exceptions ... when starting more than one rtadvd
(on different routers) we expect to receive an RA from each, but
all that we can check is that we received the (at least) right number
of RAs.  It is possible (though unlikely) that one router sent two
before another sent any, in which case we will not have the data we
expect, and a sub-test will fail.

Second, there is no way to know for sure that we have waited long
enough when we're waiting for data to expire - in systems with
correctly working clocks that actually measure time, this should not
be an issue, if data is due to expire in < 5 seconds, and we wait
5 seconds, and the data is still there, then that indicates a
failure, which should be detected.   Unfortunately with QEMU testing
time just isn't that reliable.  But fortunately, it is generally the
sleep which takes longer, while other timers run correctly, which is
the way that makes us happy...

While here lots of cleanups - everything from white space and
line wrapping, to removing superfluous quotes and adding some
(but probably not enough) that are not (though given the data is
all known here, lack of quotes will rarely hurt.)

Also take note of the fact that current rtadvd *cannot* delete its
pidfile, so waiting for that file to be removed is doomed to failure.
Do things in a way that works, rather than simply resorting to assassination.

Because we do a lot less "sleep and hope it is long enough" and more
"wait until it is observed to happen" the tests generally run in less
elapsed time than before (20% less has been observed.)  But because we
"wait until it is observed to happen" rather than just "sleep and hope
it is long enough" sometimes things take longer (and when that happens,
we no longer fail).  Up to 7% slower (overall) has been observed.
(Observations on an amd64 DomU, no idea yet as to what QEMU might observe.)
2017-11-25 07:58:47 +00:00
kre fa3a535c5c When comparing doubles (any floating point values) which have been
computed using different methods, don't expect to achieve identical
results (here, one constant is perhaps converted to binary from a string by
a cross compiler, the other is converted at run time).   Allow them to
have a small difference (for now, small is < 1e-7 - the constant is ~ 1e5,
so this is 12 orders of magnitude less) before failing (and include the
actual difference in the error message if it does fail.)
2017-11-24 21:30:43 +00:00
kre ec8433427a Fix the ndp_rtm test the same way the arp_rtm test was fixed:
1. get pid of bg process with $! not $?
2. expect a single message from route monitor, not two, after ndp -d
3. run atf_check just once to verify correct output, not once for each string
2017-11-24 03:38:32 +00:00
kre 91d7a90044 Cosmetic changes, NFC intended.
1. get rid of the "$*" fetish.
2. more consistency (not complete .. yet) with RUMP_SERVER setting
3. white space (esp around pipe ('|') symbols.)
4. drop unnecessary \ line joining.
2017-11-24 03:28:49 +00:00
kre b19b969600 Add some diagnostics to the strto test, so I can see why this
fails on i386 (on qemu) - will probably keep them when done.
2017-11-23 23:47:09 +00:00
kre af284e4305 Clean up the arp_rtm subtest...
1. Be assertive when claiming the pid of the background route monitor command,
   not polite...  (ie: $! will give you the pid, $? is just 0 there).
2. Since "wait 0" simply (always) exits with status 127, immediately (we
   know without thinking that we have no child with pid 0) the waits were
   ineffective - now (after fix #1) they work .. which requires the
   route monitor that watches the arp -d to exit after 1 message, not 2,
   as 1 is all it gets.   (If there really should be 2, someone needs to
   find out why the kernel is sending only 1 - I am not that someone).
3. The file contents need to be read only once, no matter how many patterns
   we need to look for, save some work, and do it that way (this is not
   really a bug,m but saving time for the ATF tests is always a good thing.)

Not sure if this will stop it randomly failing on bablyon5, but it might.
(The likely cause is that the "route.monitor" has not flushed its stdout
buffers at the time the "grep -A 3"  [aside: why that way to read the file??]
is performed, so fails to find its expected output ... the route monitor would
get an extra message once interfaces start being destroyed, I assume, and
would exit then, flushing its buffer, but by then it is too late.
If that is/was the cause, then it should be fixed now.)
2017-11-23 06:22:12 +00:00
kre 995ebd076a Since there was already a test to verify that vlan tag 4096 is
detected as invalid, become the "someone" referred to in the
previous commit log, and add tests for 0 and 4095 as well, and
while here, throw in a few more that might elicit bugs.

And if the shell running the tests is able, add tests of a few
random vlan tags between 2 and 4093 (1 and 4094 are always tested)
to check that anything in range works (well, partially check...)
2017-11-23 04:59:49 +00:00
kre 9327d63f48 Don't attempt to test vlan tags 0 or 4095, which are now rejected
as invalid (perhaps someone could add a test to verify that they
continue to be rejected?)
2017-11-23 04:12:36 +00:00
kre 1cec45a93f PR lib/52007
Move libevent from being a test playing sub-directory, to a groupy,
just hanging around, hoping someone will notice it, and throw it
a bone...  (mixed metaphors?)
2017-11-23 02:40:01 +00:00
martin c567f1919d ATF test program for PR kern/52738: check for mtime updates after rewriting
a file.
2017-11-19 21:05:26 +00:00
martin 7886ea7b21 PR kern/52167 strikes on sparc64 too. 2017-11-18 17:00:00 +00:00
kre a60600e0af Add a test case for "set -X".
Currently (or when testing any shell that does not support -X) the
test will be skipped (also for [m]ksh (but not ksh93 etc) where there
is an absurdly badly named -X option, skip the new test for them as well.)

When -X appears in /bin/sh, this will verify that it is probably working
(the test is MUCH more gruelling than any rational use of -X would be.)
2017-11-16 19:41:41 +00:00
msaitoh a799b2bceb Add test case of vlan(4)'s re-configure without destroy
(see also if_vlan.c rev. 1.104). Written by s-yamaguchi@iij.
2017-11-16 06:31:00 +00:00
ozaki-r 6676be48c1 Dedup some checks
And the change a bit optimizes checks of SA expirations, which
may shorten testing time.
2017-11-09 04:51:07 +00:00
ozaki-r eb73cc98c0 "Mark key_timehandler_ch callout as MP-safe" change needs one more sec to make lifetime tests stable 2017-11-09 04:50:37 +00:00
ozaki-r 7c8e9ac519 Stop using bpfjit
Because most architectures don't support it and npf still works without it.
2017-11-07 09:17:06 +00:00
ozaki-r a048c07157 Let rtadvd not use syslog for logging
Thanks to christos@ now rtadvd can log via stderr instead of syslog
by -D option.

Address PR bin/52701
2017-11-07 02:19:23 +00:00
kre 4559590210 In the fopen_regular and fopen_symlink tests, when (that is, if) a
failure occurs, distinguish in the failure message the cases where the
open succeeded (and should not have), and where it failed, but not for
the expected reason (the "wrong errno" case not tested, would require
manufacturing a broken kernel...).

Add O_NOFOLLOW ('l' mode modifier) tests to the fopen_mode test case
(tests that are intended to open the file) and also add a few missing
commas which were causing a few of the sub-tests to be skipped, and
others to be not quite testing exactly what was intended.
2017-11-06 23:06:55 +00:00
joerg da03f1ef14 init/fini for the main program is handled by crt0.o, so ifunc handling
is skipped right now as it iterates the same list. Don't repeat that
mistake and explicitly take care of it in the dynamic linker.
2017-11-06 21:16:03 +00:00
christos f3898d4d3b add a symlink test 2017-11-06 17:32:53 +00:00
ozaki-r 3339f807e5 Kill rtadvd surely even if the tests fail in the middle
It may help PR bin/52701.
2017-11-06 10:51:40 +00:00
ozaki-r 0de7b04927 Add test cases of NAT-T (transport mode)
A small C program is added to make a special socket (UDP_ENCAP_ESPINUDP)
and keep it to handle UDP-encapsulated ESP packets.
2017-10-30 15:59:23 +00:00
christos 38e7108a2d fix typo 2017-10-28 19:25:31 +00:00
christos 8bf35d4ee1 make tests print the values. 2017-10-28 19:24:55 +00:00
kre 001379fb42 The Zone test was obviously intended to test %Z rather than %z, otherwise
it would be (and has been) identical to the zone test, which would be a
pointless waste of time.
2017-10-27 05:14:11 +00:00
ozaki-r 0d858128c2 Handle esp-udp for NAT-T 2017-10-27 04:31:50 +00:00
kre 934582a916 Remove bogus errno checks, mktime() (and timegm()) does not guarantee
to leave errno unaltered if there is no error.   And does not.

While here, write -1 the same way everyone else does (not ~0, which
would not even be negative on a 1's complement host, if you can find one).

And while not needed for the test, but so that if checked, the result is
more likely to be what is anticipated, set tm_mday to an in-range value
in the mtime_negyear test (otherwise the correction results in the result
movng backwards to the last day of the previous month, which is the
end of Decemper, 1898, rather than the 1899 one would expect from year -1.)
2017-10-27 00:55:27 +00:00
ozaki-r 690df934db Add test cases for one SP with multiple SAs
These are for a bug reported recently which modifies SPs accidentally.
2017-10-20 03:45:47 +00:00
ozaki-r d031869d08 Suppress name resolution 2017-10-20 03:45:02 +00:00
ozaki-r 101922ebfc Fix incomplete SP setups 2017-10-20 03:43:51 +00:00
ozaki-r 25af614d05 Show packet counters 2017-10-20 03:42:53 +00:00
ryo 638374d825 add test case for new format 'f' and 'F' 2017-10-14 18:41:44 +00:00
msaitoh e75346fc5c Add a test case for duplicated VLAN ID. 2017-10-11 08:10:53 +00:00
kre 981c4cd0ef Make most of the resize_ffs tests skip if PUFFS is not configured
in the kernel.   (nb: for this purpose, a module that is configured
to autoload counts as configured in the kernel...)
2017-10-08 21:12:27 +00:00
kre 97beabe6b7 Don't bother attempting any of the (real) test cases if the SYSVMSG
option isn't configured in the kernel.
2017-10-08 08:31:05 +00:00
kre 1b3e61a16f Skip the mincore_shmseg test case if the SYSVSHM option is not configured
in the kernel.
2017-10-08 08:29:57 +00:00
kre 6618a9bf1f If we have SYSVMSG in kernel (test finds it) restore the signal handler
to its previous state, so any signals that occur during the rest of the
test gat handled just as they would (core dump) as if the handler was never
executed.   No need to bother if the SYSVMSG test fails, as in that case,
nothing else will be done anyway.
2017-10-07 17:15:44 +00:00
kre 5c624ca98d Add a new sub-test to validate ~ expansions.
Currently testing ~user is too much effort to contemplate (other than
assuming that it works in order to verify that it works...) so only bare ~
is being tested for now.   Maybe someday...

Right now (@ time of commit), this new test is expected to fail, as ~
expansions are horribly badly broken (have been for months, some forms
for much longer) in all but the simplest of uses.   Fix for that coming
very soon.
2017-10-06 17:05:05 +00:00
kre 4ad1e3d9c8 Make this test skip if running on a kernel without the SYSVMSG option.
(Assuming this behaves as intended the other tests which should behave
the same way will get upgrades as well.)
2017-10-06 17:00:28 +00:00
pgoyette a3959c1f67 Update recently-added test to adapt to new signature of LIST_MOVE() 2017-10-02 05:14:29 +00:00