Commit Graph

53 Commits

Author SHA1 Message Date
roy 17da0e5463 tests: check RTA_AUTHOR in messages 2020-03-11 08:52:13 +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 ce0ae1dfed tests: use rump_server_add_iface to create interfaces 2019-08-19 03:22:05 +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 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 4cb98a5a0c Improve packet checks and error reporting 2018-04-06 09:21:57 +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
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 fcbd6bf4fa Drop RTF_LLINFO flag (now it's RTF_LLDATA) from local routes
They don't have llinfo anymore. And also the change fixes unexpected
behavior of ARP proxy.
2017-06-28 04:10:47 +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 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 04ce7456cf Set net.inet.arp.keep only if it's required 2017-06-21 03:10:42 +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 24d1e180c8 Improve test stability and output messages on failure 2017-03-11 02:01:10 +00:00
ozaki-r d2352b812f Improve test stability and output messages on failure 2017-03-08 05:30:56 +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 58be5ec9a6 Add missing bus argument for extract_new_packets 2016-11-24 11:34:51 +00:00
ozaki-r 554c6ec338 Move get_macaddr to net_common.sh 2016-11-24 09:07:09 +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
christos 12f0b47e19 adjust for new ifconfig output. 2016-09-14 16:00:10 +00:00
christos f1061bbd2c no functional change 2016-08-23 16:03:45 +00:00
kre 71c9d3421c + -lrumpdev 2016-08-10 22:05:07 +00:00
ozaki-r f91dfc925e Make a bunch of test names self-descriptive 2016-06-21 05:04:16 +00:00
ozaki-r 095fdb0468 Add a test case for static ARP
It tests receiving an ARP request that has a spa (i.e., IP address) whose
ARP entry already exists in the table as a static ARP entry.
2016-04-18 02:27:34 +00:00
ozaki-r 09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
ozaki-r 8ce75dc03a Improve tests of proxy arp
The tests make it clear how it behaves though, I don't know if the current
behavior is what it should be.
2016-03-04 04:18:44 +00:00
ozaki-r 520486c340 Add tests on activating a new MAC address 2016-02-29 09:35:16 +00:00
ozaki-r f6036fa401 Add basic tests for Proxy ARP
The tests don't much enough and need more realitic tests, for example
tests for a setup using ppp found in PR 44032.
2016-02-25 03:23:15 +00:00
ozaki-r 88c8544847 Make checks strict
rump.arp should fail with File exists (EEXIST).
2015-12-02 06:05:14 +00:00
ozaki-r 0dac802154 Reflect the current ARP cache implementation in tests
net.inet.arp.prune and net.inet.arp.refresh were obsoleted.
2015-08-31 08:08:20 +00:00
ozaki-r 67b961d3c9 Give a chance to send a DAD announce packet
ifconfig -w ensures IP addresses have left tentative state, however,
it doesn't guarantee that a DAD announce packet is sent. The kernel
clears tentative flag and then sends the packet so that ifconfig -w
can return before the kernel sends the packet.
2015-08-25 02:24:34 +00:00
ozaki-r 1a07436188 Disable another tentative state check
It's too ephemeral to check robustly.
2015-08-24 02:02:25 +00:00
ozaki-r e266b2d0dd Improve test stability
- Take a diff between packet dumps and use it for packet checking
  - it's resistant against packet reorder
- Seep 2 sec to make sure a NS message is sent
- Disable tentative state check for now
  - it's too ephemeral to check robustly
2015-08-17 07:06:58 +00:00
ozaki-r 14dcf9ff75 Reflect a fix on rt_refcnt
The test was adjusted based on wrong behavior.
2015-08-13 10:22:21 +00:00
ozaki-r 17bcc6ffef Check MAC address of ARP caches additionally 2015-08-07 05:32:12 +00:00
ozaki-r 25711fd317 Return 0 explicitly to avoid unexpected failures when $DEBUG=false 2015-07-31 10:16:36 +00:00
ozaki-r 6abe86b9fd Add tests of cache overwriting 2015-07-31 02:39:12 +00:00
ozaki-r bf665d2f84 Add tests for temp option 2015-07-31 02:35:09 +00:00
ozaki-r 5d6a850962 Remove remaining debug code 2015-07-31 00:23:54 +00:00
ozaki-r 5e8861aca5 Fix cleanup; halt all running rump_servers 2015-07-31 00:22:44 +00:00
ozaki-r 7a175f4063 Add tests for arp -a option 2015-07-30 08:41:18 +00:00
ozaki-r 3fd3aaa9ea Fix TESTS_SH assignment 2015-07-30 05:43:42 +00:00