Skip test if feature security_capabilities is not available

PR:		236863
Approved by:	asomers
MFC after:	1 month
Sponsored by:	Netflix
This commit is contained in:
Olivier Cochard 2019-03-29 08:43:21 +00:00
parent 45916554cc
commit 08e5c473f1
2 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ TESTSDIR= ${TESTSBASE}/sys/capsicum
ATF_TESTS_C+= bindat_connectat ATF_TESTS_C+= bindat_connectat
ATF_TESTS_C+= ioctls_test ATF_TESTS_C+= ioctls_test
CFLAGS.bindat_connectat.c+= -I${SRCTOP}/tests CFLAGS+= -I${SRCTOP}/tests
WARNS?= 6 WARNS?= 6

View File

@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
#include <atf-c.h> #include <atf-c.h>
#include "freebsd_test_suite/macros.h"
/* /*
* A variant of ATF_REQUIRE that is suitable for use in child * A variant of ATF_REQUIRE that is suitable for use in child
* processes. This only works if the parent process is tripped up by * processes. This only works if the parent process is tripped up by
@ -73,6 +75,8 @@ ATF_TC_BODY(cap_ioctls__listen_copy, tc)
char dummy; char dummy;
int s[2], status; int s[2], status;
ATF_REQUIRE_FEATURE("security_capabilities");
s[0] = socket(AF_INET, SOCK_STREAM, 0); s[0] = socket(AF_INET, SOCK_STREAM, 0);
ATF_REQUIRE(s[0] > 0); ATF_REQUIRE(s[0] > 0);