Page MenuHomeFreeBSD

if_ovpn tests: destroy an if_ovpn interface before it's been used
ClosedPublic

Authored by kp on Sep 9 2024, 9:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 4:25 AM
Unknown Object (File)
Wed, Oct 30, 10:32 PM
Unknown Object (File)
Tue, Oct 29, 4:24 PM
Unknown Object (File)
Sat, Oct 26, 7:23 AM
Unknown Object (File)
Sat, Oct 26, 6:44 AM
Unknown Object (File)
Wed, Oct 23, 3:44 AM
Unknown Object (File)
Sat, Oct 19, 11:24 PM
Unknown Object (File)
Sat, Oct 19, 4:24 PM

Details

Summary

Ensure that we correctly clean up even if the interface never gets a socket
assigned.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Sep 9 2024, 9:36 PM
markj added inline comments.
tests/sys/net/if_ovpn/if_ovpn.sh
1063

Use atf_check?

You can do the same for ifconfig ovpn create by saving output to a file first, though that's a bit clunky.

tests/sys/net/if_ovpn/if_ovpn.sh
1063

Yeah, I may as well.

The intent is to test for a bug I had in the preceding patch, which would cause a panic if we destroyed an ovpn interface that never had a socket attached. We don't need atf_check to detect that, but we might get other bugs that we would detect that way.
(Although atf_sh would already complain if we get a non-zero exit status from the test body, so it's more stylistic than functional in this case.)

tests/sys/net/if_ovpn/if_ovpn.sh
1063

I'm inclined to do the same for the vnet.subr helpers. When reading kyua debug output, it's a bit easier to follow if commands use atf_check, since they get logged.

tests/sys/net/if_ovpn/if_ovpn.sh
1063

I think it should be -s exit:0. I believe it can be omitted actually.

This revision is now accepted and ready to land.Sep 10 2024, 3:32 PM