Page MenuHomeFreeBSD

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

Authored by jhb on Nov 15 2022, 9:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 9:30 PM
Unknown Object (File)
Jan 31 2024, 7:54 AM
Unknown Object (File)
Dec 23 2023, 2:13 AM
Unknown Object (File)
Dec 12 2023, 7:38 AM
Unknown Object (File)
Nov 14 2023, 8:25 AM
Unknown Object (File)
Nov 4 2023, 6:57 AM
Unknown Object (File)
Sep 2 2023, 7:54 AM
Unknown Object (File)
Jul 11 2023, 11:41 PM

Details

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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Nov 15 2022, 9:36 PM
markj added inline comments.
tests/sys/netinet/if_wg.sh
91 ↗(On Diff #113161)

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

92 ↗(On Diff #113161)

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.Nov 15 2022, 11:55 PM
tests/sys/netinet/if_wg.sh
91 ↗(On Diff #113161)

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 ↗(On Diff #113161)

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 ↗(On Diff #113161)

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).

Move to sys/net and use ping -c 1

This revision now requires review to proceed.Dec 9 2022, 5:51 PM

sys/net has many other if_<foo>.sh tests, so it seems like a better directory for this than sys/netinet.

tests/sys/net/if_wg.sh
92

Because atf-check hates developers, I can't actually see the output of ping(1) to confirm it works, but the test does pass locally for me.

tests/sys/net/if_wg.sh
92

Just in case - there’s s python atf interface based on pytest which doesn’t hate developers :-) it also has an easy way to deal w/multiple jails.

@kevans are you happier with this version which uses -c 1?

In D37400#857850, @jhb wrote:

@kevans are you happier with this version which uses -c 1?

Yes, thanks!

This revision is now accepted and ready to land.Dec 16 2022, 6:50 PM
This revision was automatically updated to reflect the committed changes.