From 69361b8785468fe15bb2b169a0b72af5bc108cfa Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Tue, 28 Feb 2023 11:14:24 +0100 Subject: 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") --- tests/sys/net/if_ovpn/if_ovpn_c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/if_ovpn/if_ovpn_c.c b/tests/sys/net/if_ovpn/if_ovpn_c.c index d98f5a0dd8e6..fa8a9a07fa35 100644 --- a/tests/sys/net/if_ovpn/if_ovpn_c.c +++ b/tests/sys/net/if_ovpn/if_ovpn_c.c @@ -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); -- cgit v1.2.3