Commit Graph

636 Commits

Author SHA1 Message Date
yamaguchi
0c3bbc580c atf: add test cases for MTU that is increased on SIOCSETVLAN
From t-kusaba@IIJ, thanks
2019-11-11 02:40:48 +00:00
christos
a33f2da334 - use accept4 instead of paccept for everyone.
- add test for accept preserving non-block
- comment on FreeBSD and Linux behavior.
2019-10-26 23:08:27 +00:00
ozaki-r
3cb3151cb2 tests: add tests for the validateion of net.inet6.ip6.temppltime 2019-10-16 07:42:22 +00:00
mrg
4e545ef793 ifr_name is nul terminated. make it so. 2019-10-13 07:46:16 +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
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
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
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
ozaki-r
ac002ee323 tests: add tests for getspi and udpate 2019-07-23 04:31:25 +00:00
ozaki-r
2f33341a03 tests: extract all kernel logs, not just a panic message, from rump_server.core 2019-07-18 04:22:22 +00:00
ozaki-r
bc1d718ff0 tests: shorten the expire time of neighbor caches to reduce the runtime of the tests 2019-07-18 04:00:09 +00:00
ozaki-r
a96cce565c tests: check that a new cache is not created over the limit 2019-07-09 02:50:24 +00:00
ozaki-r
24bc91d9f1 Add ATF test for a description.
From t-kusaba@IIJ
2019-07-04 02:46:40 +00:00
ozaki-r
2ed6d11366 tests: test state transitions of neighbor caches 2019-06-28 06:46:04 +00:00
skrll
b801bf2f56 Another spello of 'unknown' 2019-06-24 06:26:29 +00:00
gson
dd9a375876 In the "got %d/%d" message printed at the end of the pingsize test,
make the latter number show the actual number of ICMP packets the test
attempted to send.  Thus, the two numbers can now be meaningfully
compared, and their difference indicates the number of packets lost.
2019-06-11 08:34:01 +00:00
kre
9c62ddd5c1 Deal with fallout from the addition of
KERN_PROC_CWD in sysctl(3)
That is kern.proc.$$.KERN_PROC_CWD (I think - not that it matters here)

The effect is that -lrump now requires -lrumpvfs

This set of changes fixes (I believe) regular dynamic builds,
more might be required for static builds (will be verified soon).
2019-06-01 06:59:17 +00:00
gson
db7bf52ef5 Increase the timeout for the manyaddrs test case; the default is often
insufficient under qemu.
2019-05-31 15:36:10 +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
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
christos
f2519f7f77 ifix uninialized pid 2019-04-14 01:45:30 +00:00
knakahara
6e581475e6 Add ATF for ipsecif(4) pfil. 2019-01-17 02:49:11 +00:00
knakahara
06a59f7e0a Fix PR kern/53848. Add missing "ifconfig -w". 2019-01-15 05:34:37 +00:00
knakahara
2127b06f61 revert t_ipsec.sh:r1.7 2019-01-15 05:33:42 +00:00
knakahara
b6794f2f31 workaround for PR kern/53848 2019-01-11 08:05:52 +00:00
knakahara
3a6c5e3f5d tests/net/if_ipsec/t_ipsec disable dad. This may fix PR kern/53848 2019-01-10 00:45:08 +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
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
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
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
knakahara
3d0c03bef5 let ATF detect a bug fixed by if_vla.c:r1.132. 2018-11-14 05:07:48 +00:00
ozaki-r
82733c9693 Add a test to show a large number of MAC addresses cached in a bridge 2018-11-09 06:45:03 +00:00
yamaguchi
c9cc6dd9e6 Update the error message in t_vlan (ENXIO => EINVAL)
ok ozaki-r@
2018-06-14 08:38:24 +00:00
yamaguchi
9de5f4c04e Add test cases for multicast address handling of vlan(4)
ok ozaki-r@
2018-06-14 08:22:52 +00:00
ozaki-r
9da465c4ef Add tests of vlan with bridge
The tests trigger a panic reported in PR kern/53357.
2018-06-12 04:21:22 +00:00
maxv
8ad8ab65b1 Remove ping6_opts_hops, "-g" does not exist anymore (RH0 removed). 2018-04-26 06:23:33 +00:00
ozaki-r
0be59150b6 Add a test that checks if brconfig flush surely removes all entries 2018-04-18 04:03:12 +00:00
ozaki-r
f72ad93267 Add a test case for bridge_rtdelete 2018-04-10 07:09:00 +00:00
ozaki-r
810a5ee058 Fix typo 2018-04-07 12:36:58 +00:00
ozaki-r
6ca7de5d0d Add tests for GARP without DAD
Additionally make the existing tests for GARP more explicit.
2018-04-06 09:23:36 +00:00
ozaki-r
9e4591fa4a Show outputs of commands if $DEBUG 2018-04-06 09:22:38 +00:00
ozaki-r
4cb98a5a0c Improve packet checks and error reporting 2018-04-06 09:21:57 +00:00
roy
64785daad7 Handle errors better.
Fix test for checking we sent all the data we asked to.
2018-03-26 09:11:15 +00:00
roy
8a9420adee Allow a valid sendto .... duh 2018-03-24 15:51:57 +00:00
kamil
62ac00a826 Fix a printf(3)-like format in ATF ICMP t_ping.c
Use %zd for ssize_t, instead of %d.
2018-03-24 00:06:32 +00:00
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