Page MenuHomeFreeBSD

wg: Re-add basic if_wg(4) tests.
AcceptedPublic

Authored by jhb on Tue, Nov 15, 9:36 PM.

Details

Reviewers
markj
kevans
Summary

These were originally added in commit
74ae3f3e33b810248da19004c58b3581cd367843 but have been updated to use
wg(8).

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 48371
Build 45257: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Tue, Nov 15, 9:36 PM
markj added inline comments.
tests/sys/netinet/if_wg.sh
91

I think the -i 0.25 doesn't do anything, since we're only sending one packet.

92

It would be cool to do a ping sweep with different packet sizes (ipsec tests would benefit from that too), but our ping(8) doesn't have some options I'd want:

  • exit with status != 0 if any responses fail to arrive
  • send the next packet as soon as the previous one was received (-i is close to what I'd want, but not quite)
This revision is now accepted and ready to land.Tue, Nov 15, 11:55 PM
tests/sys/netinet/if_wg.sh
91

Hmm, we aren't passing -c 1, so we are potentially sending more than one packet, we just stop sending once we get back a single reply (-o). I think the issue is that the first ping can be "lost" because it can take a bit to get the connection to wakeup? At the least, this was in the original test in the tree (that has your copyright, so presumably you wrote?)

92

For wireguard you'd want some -o like behavior still, or maybe you'd want two invocations, one that is the current one with -o that waits for the connection to come up, and then a second one that does the ping sweep you describe.

tests/sys/netinet/if_wg.sh
91

I don't think we should ever drop the first packet here. There was a bug in a previous iteration where we'd lose the packet that initiated the handshake, perhaps this predated the fix (I don't recall if we had actually fixed that while it was in the tree, but I don't think we did).