if_ovpn tests: skip the if_ovpn_c test if if_ovpn.ko isn't loaded

Skip the test (rather than loading it) if if_ovpn.ko isn't loaded. Match
the behaviour of other tests.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2023-02-28 11:14:24 +01:00
parent 8dff0b6761
commit 69361b8785

View File

@ -88,7 +88,8 @@ ATF_TC_BODY(tcp, tc)
nvlist_t *nvl;
/* Ensure the module is loaded. */
(void)kldload("if_ovpn");
if (kldfind("if_ovpn") == -1 && errno == ENOENT)
atf_tc_skip("if_ovpn not loaded");
ovpn_fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);