Commit Graph

65 Commits

Author SHA1 Message Date
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
ozaki-r
5a2201ed49 Move HIJACKING definition to net_common.sh 2016-11-24 09:03:53 +00:00
ozaki-r
d64bc47ffa Reduce duplicate codes
Introduce net_common.sh that is to share common functions used in tests
for networking. This commit commonizes extract_new_packets. Other duplicate
codes will be moved to the file in further commits.
2016-11-24 08:52:19 +00:00
ozaki-r
1c189061c4 Accept DEBUG environment variable
By doing so, we can easily turn DEBUG on/off without modifying
the ATF scripts.
2016-11-07 05:25:36 +00:00
ozaki-r
51460776c2 Make test names self-descriptive 2016-10-20 09:51:15 +00:00
ozaki-r
b6cf257731 Add tests for sysctl net.inet6.ip6.dad_count
From suzu-ken@IIJ
2016-10-04 03:41:33 +00:00
ozaki-r
d94096e467 Ignore case in duplicated 2016-09-16 00:50:43 +00:00
ozaki-r
2393c05ab0 Adjust for new ifconfig output
And use -o match to provide informative error messages.
2016-09-16 00:14:33 +00:00
kre
e9acd28970 + -lrumpdev 2016-08-10 23:07:57 +00:00
ozaki-r
f91dfc925e Make a bunch of test names self-descriptive 2016-06-21 05:04:16 +00:00
ozaki-r
7fa1e6be86 Adjust the tests for temp option that works now
See PR kern/50127
2016-05-20 06:48:52 +00:00