Commit Graph

75 Commits

Author SHA1 Message Date
roy fc25529d69 ndp_rtm: Only ping once
Pointless doing 3 pings.
On a slow system, it's possible that many RTM_MISS messages could
overflow into the next test.
2020-09-17 11:56:35 +00:00
roy b05648aa26 Remove in-kernel handling of Router Advertisements
This is much better handled by a user-land tool.
Proposed on tech-net here:
https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html

Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now
needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl.

Compat is fully provided where it makes sense, but trying to turn on
RA handling will obviously throw an error as it no longer exists.

Note that if you use IPv6 temporary addresses, this now needs to be
turned on in dhcpcd.conf(5) rather than in sysctl.conf(5).
2020-06-12 11:04:44 +00:00
roy a6837a9b93 tests: ndp_rtm: Check correct source address in RTA_AUTHOR
Fixes PR kern/55074.
2020-03-15 21:15:25 +00:00
roy 17da0e5463 tests: check RTA_AUTHOR in messages 2020-03-11 08:52:13 +00:00
ozaki-r 3cb3151cb2 tests: add tests for the validateion of net.inet6.ip6.temppltime 2019-10-16 07:42:22 +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 3a470f73b4 tests: fix test header name 2019-08-19 03:20:27 +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 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 2ed6d11366 tests: test state transitions of neighbor caches 2019-06-28 06:46:04 +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
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
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
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 3f42983046 Enable to remove multiple ARP/NDP entries for one destination
The kernel can have multiple ARP/NDP entries which have an indentical
destination on different interfaces. This is normal and can be
reproduce easily by ping -I or ping6 -S. We should be able to remove
such entries.

arp -d <ip> and ndp -d <ip> are changed to fetch all ARP/NDP entries
and remove matched entries. So we can remove multiple entries
described above. This fetch all and selective removal behavior is
the same as arp <ip> and ndp <ip>; they also do fetch all entries
and show only matched entries.

Related to PR 51179
2017-06-28 08:17:50 +00:00
ozaki-r da803ed70d Restore ARP/NDP entries to route show and netstat -r
Requested by dyoung@ some time ago
2017-06-28 04:14:53 +00:00
ozaki-r 59bb97369e Drop RTF_UP from a routing message of a deleted ARP/NDP entry 2017-06-26 06:59:56 +00:00
ozaki-r 057fd82362 Improve backward compatibility of (fake) routing messages on adding an ARP/NDP entry
A message originally included only DST and GATEWAY. Restore it.
2017-06-26 03:16:28 +00:00
ozaki-r 60f1157fbd Fix usage of routing messages on arp -d and ndp -d
It didn't work as we expected; we should set RTA_GATEWAY not
RTA_IFP on RTM_GET to return an if_index and the kernel should
use it on RTM_DELETE.
2017-06-26 03:13:40 +00:00
ozaki-r f86487ba70 Test implicit removals of ARP/NDP entries
One test case reproudces PR 51179.
2017-06-22 10:06:33 +00:00
ozaki-r 3659ef5665 Purge all related L2 caches on removing a route
The change addresses situations similar to PR 51179.
2017-06-22 09:56:48 +00:00
ozaki-r 68c930f9c3 Fix typo 2017-06-22 09:05:02 +00:00
ozaki-r dc9233b94b Don't create a permanent L2 cache entry on adding an address to an interface
It was created to copy FreeBSD, however actually the cache isn't
necessary. Remove it to simplify the code and reduce the cost to
maintain it (e.g., keep a consistency with a corresponding local
route).
2017-06-21 09:05:31 +00:00
ozaki-r 72ce3b3ae5 Add missing declarations for cleanup 2017-06-19 10:57:37 +00:00
ozaki-r e40a78484b Test routing messages emitted on operations of ARP/NDP entries 2017-06-16 04:41:02 +00:00
ozaki-r b8bb1e4f6c Change the default value of DEBUG of stable tests to false 2017-05-26 01:14:38 +00:00
ozaki-r 8155a2ae5c Provide a more robust regexp for time formats of 1day-ish 2017-03-03 07:34:04 +00:00
ozaki-r 9e6e8d7cf9 Add tests for expiration of default router and prefix entries 2017-02-22 03:03:37 +00:00
ozaki-r a0d1dbdc06 Remove a check added wrongly 2017-01-13 08:11:01 +00:00
ozaki-r 6fe17373ab Add tests for net.inet6.ip6.prefer_tempaddr 2017-01-13 06:30:33 +00:00
ozaki-r ade7bb4d73 Remove extra checks and cleanup 2017-01-13 06:30:09 +00:00
ozaki-r 79ca97d6c8 Cope with tentative state 2017-01-11 07:22:43 +00:00
ozaki-r 285906a96f Add a test case for IPv6 temporary address 2017-01-11 03:15:44 +00:00
ozaki-r 5722f72db4 Check autoconf flag 2017-01-11 03:15:11 +00:00
ozaki-r aeb848823f Fix typo 2016-12-26 01:26:25 +00:00
ozaki-r 60ce16b544 Restore multiple_routers_single_prefix_cleanup removed wrongly 2016-12-21 07:02:16 +00:00
ozaki-r b9cb282dd4 Reduce unnecessary wait 2016-12-20 10:12:24 +00:00
ozaki-r eb8acbc1b3 Add a test case for exceeding the number of maximum prefixes
The test case pinpoints purge_detached.
2016-12-19 03:07:05 +00:00
ozaki-r 065169a5d4 Add tests for multiple routers with a single prefix 2016-12-19 02:27:02 +00:00
ozaki-r 5c83990e6b Fix the description of a test 2016-12-19 01:37:30 +00:00
ozaki-r 11a1604c2d Add tests for multiple routers 2016-12-16 09:11:18 +00:00
ozaki-r 2e89e8b1dc Unify common routines 2016-12-16 09:10:37 +00:00
ozaki-r 237c29ba3d Avoid using /var/run/rump.rtadvd.pid 2016-12-16 09:10:08 +00:00
ozaki-r 6e275c7668 Add a test case that deletes auto-configured addresses 2016-12-16 03:49:45 +00:00
ozaki-r da9347803d Improve stability of the tests
- Do ifconfig -w 10 after ifconfig up
- Accept /1d0h0m..s/ in addition to /23h59m..s/ for expiration time
- Prevent new RA messages from coming after flushing entries

The changes should fix flapping of test results on babylon5.
2016-12-16 03:14:23 +00:00
ozaki-r df9d638687 Add tests for flushing prefix and default router entries 2016-12-14 07:37:26 +00:00
ozaki-r 5a83ceea44 Share rump_server start/stop and interface creation/destruction functions
The common functions store socks of rump_servers, interfaces of rump_servers
and buses that intefaces connect and allow to destroy them with common
functions without specifying which socks, interfaces and buses we should
destroy.

This change reduces lots of similar setup/cleanup codes.
2016-11-25 08:51:16 +00:00