Page MenuHomeFreeBSD

Add a basic smoke test for if_wg
ClosedPublic

Authored by markj on Mar 11 2021, 4:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 6, 2:10 PM
Unknown Object (File)
Fri, Sep 26, 7:10 AM
Unknown Object (File)
Sep 13 2025, 3:37 AM
Unknown Object (File)
Aug 6 2025, 12:50 AM
Unknown Object (File)
Jul 31 2025, 9:00 PM
Unknown Object (File)
Jun 30 2025, 7:54 PM
Unknown Object (File)
Jun 29 2025, 7:48 PM
Unknown Object (File)
Jun 25 2025, 8:15 AM

Details

Reviewers
kevans

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37773
Build 34662: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mar 11 2021, 4:38 PM
This revision is now accepted and ready to land.Mar 12 2021, 5:42 AM

I saw the upstream commit to use the ifnet creator's creds for the socket, so one can keep the wg socket in the host after moving the interface into a child vnet. Working on a test for that too.

I saw the upstream commit to use the ifnet creator's creds for the socket, so one can keep the wg socket in the host after moving the interface into a child vnet. Working on a test for that too.

Excellent, thanks! It's currently a little broken trying to connect to external hosts, but it smells like a timer problem. tcpdump shows packets going out and packets coming back in at a rapid rate and you can observe debug messages to the console even about handshake and keepalive packets flowing.

tests/sys/netinet/if_wg_test.sh
88

After playing around with it a little bit, I'd actually recommend -o instead of -c 3 and also -i 0.25 if we can do that reliably.

tests/sys/netinet/if_wg_test.sh
88

Actually, we can probably drop the timeout entirely and just use -o. See the commit upstream about adding a stage queue -- we were consistently dropping the first icmp packet, but we shouldn't have been; that likely applies here, too.

Just a small nitpicking: do we really need _test suffix?

Just a small nitpicking: do we really need _test suffix?

No, I was following the example of other cloned interface tests (see tests/sys/net) and tried to be consistent with the majority. I will change it.

No, I was following the example of other cloned interface tests (see tests/sys/net) and tried to be consistent with the majority. I will change it.

Got it. I don't have a strong opinion. It's more curious. There are two conventions of naming in tests/sys/net so I think both of them are fine. Eventually, we should unify the naming, but that can wait after our tests get more mature.

Crap, sorry, I forgot to remove this before I merged our branch over. =(

Crap, sorry, I forgot to remove this before I merged our branch over. =(

Oh no problem. Was it worth committing at all in light of the port of netns.sh? I didn't spend much more time on this once I saw you were working on that.

Crap, sorry, I forgot to remove this before I merged our branch over. =(

Oh no problem. Was it worth committing at all in light of the port of netns.sh? I didn't spend much more time on this once I saw you were working on that.

I think it's useful to have some basic functional tests hooked up for Jenkins to bristle at -- netns.sh covers all of this, but it's a lot more like stress2 in nature

Crap, sorry, I forgot to remove this before I merged our branch over. =(

Oh no problem. Was it worth committing at all in light of the port of netns.sh? I didn't spend much more time on this once I saw you were working on that.

I think it's useful to have some basic functional tests hooked up for Jenkins to bristle at -- netns.sh covers all of this, but it's a lot more like stress2 in nature

Fair enough.