Skip if_epair regression test if module doesn't exist

Approved by:	kp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D23876
This commit is contained in:
Olivier Cochard 2020-03-03 17:35:15 +00:00
parent 1328771d9d
commit 8ccf503240
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358589
2 changed files with 5 additions and 3 deletions

View file

@ -22,6 +22,8 @@ TEST_METADATA+= is_exclusive=true
MAN=
PROGS+= randsleep
CFLAGS+= -I${.CURDIR:H:H}
WARNS?= 6
.include <bsd.test.mk>

View file

@ -40,6 +40,7 @@
#include <strings.h>
#include <atf-c.h>
#include "freebsd_test_suite/macros.h"
ATF_TC(params);
ATF_TC_HEAD(params, tc)
@ -52,9 +53,8 @@ ATF_TC_BODY(params, tc)
struct ifreq ifr;
int s;
s = kldload("if_epair");
if (s == -1 && errno != EEXIST)
atf_tc_fail("Failed to load if_epair");
kldload("if_epair");
ATF_REQUIRE_KERNEL_MODULE("if_epair");
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0)