Commit Graph

529 Commits

Author SHA1 Message Date
roy
80b75699b5 Note value received. Harden another sendto for ENOBUFS. 2018-03-23 10:05:45 +00:00
roy
05ee2584ab Handle ENOBUFS in sendto 2018-03-22 17:27:34 +00:00
roy
1875ff6c39 Handle ENOBUFS in recv 2018-03-22 17:16:05 +00:00
ozaki-r
57e881a906 Avoid setting IP addresses of the same subnet on different interface
If we do so, there will remain one route that is of a preceding address, but
that behavior is not documented and may be changed in the future.  Tests
shouldn't rely on such a unstable behavior.
2018-03-22 09:21:24 +00:00
knakahara
a0d17a179a Enhance assertion ipsecif(4) ATF to avoid confusing setkey(8) error message.
When setkey(8) says "syntax error at [-E]", it must mean get_if_ipsec_unique()
failed.
2018-03-13 03:50:26 +00:00
ozaki-r
d0486ec90d Tweak tests; increase the size of NS packets for the addition of a nonce 2018-03-07 02:30:37 +00:00
ozaki-r
6963349e89 Provide more informative reports on failures 2018-03-07 02:30:00 +00:00
christos
0f242fe63e make it compile again for those who don't have LOCAL_PEERCRED 2018-02-17 20:16:18 +00:00
christos
1d89963535 Add a test demonstrating thst LOCAL_PEEREID is busted. 2018-02-17 16:34:18 +00:00
christos
bf0b06cfe9 remove clause 3, 4. 2018-02-17 00:28:47 +00:00
christos
98cc4b91d3 Use the same variable name for the accepted socket as with the AF_LOCAL test.
Call getpeereid on the accepted socket.
2018-02-16 22:20:18 +00:00
christos
c587e5a36a make sure we call getpeername on the accepted socket! 2018-02-16 22:17:17 +00:00
christos
596e712e68 ensure that getpeereid does not succeed on tcp sockets. 2018-02-16 19:24:16 +00:00
christos
e34e5e3adb explain what's going on before we fix it. 2018-02-16 16:30:20 +00:00
christos
474def7698 add getpeereid tests for non-unix sockets, returns garbage... 2018-02-16 16:23:15 +00:00
christos
c88e952be5 add a getpeeeid test. 2018-02-16 16:08:22 +00:00
ozaki-r
def6ba19bd Fix ping_opts_gateway and ping_opts_recordroute
We need to enable the options of source routing on all rump kernels.
2018-02-09 03:53:07 +00:00
maxv
f1624eef2e Now that we don't allow source-routed packets by default, set allowsrcrt=1
and forwsrcrt=1. Should fix the ATF failure.
2018-02-08 09:56:19 +00:00
ozaki-r
95dd9007db Commonalize and add tests of creating/destroying interfaces 2018-02-01 05:22:01 +00:00
ozaki-r
11f91074e6 Change the prefix of test names to ipsecif_ to distinguish from tests for ipsec(4) 2018-01-11 07:58:22 +00:00
knakahara
b8f54fc79b add ipsec(4) interface ATF. 2018-01-10 11:06:06 +00:00
gson
ea958a7e2f Use the default ATF timeout instead of a reduced one of 5 seconds,
which isn't enough for pmax under gxemul on babylon5.netbsd.org.
2017-12-30 22:02:34 +00:00
ozaki-r
0602b7c074 Adjust outputs of route's flags to include a numeric output 2017-12-18 04:11:46 +00:00
ryo
c2f85cb6e9 As is the case with IPV6_PKTINFO, IP_PKTINFO can be sent without EADDRINUSE
even if the UDP address:port in use is specified.
2017-12-11 05:47:18 +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
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
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
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
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
ozaki-r
0d858128c2 Handle esp-udp for NAT-T 2017-10-27 04:31:50 +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
msaitoh
e75346fc5c Add a test case for duplicated VLAN ID. 2017-10-11 08:10:53 +00:00
ozaki-r
960a3e1e52 Add tests of rtcache invalidation 2017-09-20 09:36:20 +00:00
christos
64e9b5d330 add tests for 4->6 connections. 2017-08-28 10:19:57 +00:00
christos
dc977faaf4 add v6 tests 2017-08-28 09:30:29 +00:00
ryo
1581658c21 Add support IP_PKTINFO for sendmsg(2).
The source address or output interface can be specified by adding IP_PKTINFO
to the control part of the message on a SOCK_DGRAM or SOCK_RAW socket.

Reviewed by ozaki-r@ and christos@. thanks.
2017-08-10 04:31:58 +00:00
knakahara
5e20be26d9 Add counter check to vlan(4) ATF. Implemented by s-yamaguchi@IIJ, thanks. 2017-08-09 06:19:56 +00:00
ozaki-r
708290e277 Fix setkey -D -P outputs
The outputs were tweaked (by me), but I forgot updating libipsec
in my local ATF environment...
2017-08-08 02:27:03 +00:00
ozaki-r
3f30ca4e9f Clean up clunky eval strings
- Remove unnecessary \ at EOL
  - This allows to omit ; too
- Remove unnecessary quotes for arguments of atf_set
- Don't expand $DEBUG in eval
  - We expect it's expanded on execution

Suggested by kre@
2017-08-03 03:16:26 +00:00