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)
Mon, Jan 27, 5:59 AM
Unknown Object (File)
Mon, Jan 27, 5:54 AM
Unknown Object (File)
Mon, Jan 27, 5:45 AM
Unknown Object (File)
Sun, Jan 26, 9:17 AM
Unknown Object (File)
Dec 7 2024, 9:11 PM
Unknown Object (File)
Dec 7 2024, 9:11 PM
Unknown Object (File)
Dec 7 2024, 9:11 PM
Unknown Object (File)
Dec 7 2024, 9:10 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59425
Build 56312: arc lint + arc unit

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