xref: /freebsd/tests/sys/capsicum/Makefile (revision 7a7741af18d6c8a804cc643cb7ecda9d730c6aa6)
1.include <src.opts.mk>
2
3TESTSDIR=	${TESTSBASE}/sys/capsicum
4
5ATF_TESTS_C+=	bindat_connectat
6ATF_TESTS_C+=	ioctls_test
7
8CFLAGS+=	-I${SRCTOP}/tests
9
10.if ${MK_GOOGLETEST} != no
11
12.PATH: ${SRCTOP}/contrib/capsicum-test
13
14GTESTS+=	capsicum-test
15GTESTS_WRAPPER_SH.capsicum-test=	functional
16# This test script runs the same test suite twice, once as root and once as an
17# unprivileged user.  Serialize them since some tests access global namespaces,
18# e.g., mqueuefs, and can trample on each other.
19TEST_METADATA.functional+=	is_exclusive="true"
20
21SRCS.capsicum-test+=	\
22	capsicum-test-main.cc \
23	capsicum-test.cc \
24	capability-fd.cc \
25	copy_file_range.cc \
26	fexecve.cc \
27	procdesc.cc \
28	capmode.cc \
29	fcntl.cc \
30	ioctl.cc \
31	openat.cc \
32	sysctl.cc \
33	select.cc \
34	mqueue.cc \
35	socket.cc \
36	sctp.cc \
37	capability-fd-pair.cc \
38	overhead.cc \
39	rename.cc
40
41LIBADD.capsicum-test+=	gtest pthread procstat
42TEST_METADATA.capsicum-test=	required_user="unprivileged"
43
44.for p in mini-me mini-me.noexec mini-me.setuid
45PROGS+=		$p
46NO_SHARED.$p=
47SRCS.$p=	mini-me.c
48.endfor
49.if ${MK_ASAN} != "no" || ${MK_UBSAN} != "no"
50# mini-me.o is linked into a static binary so we can't use sanitizers.
51# Note: We have to set CFLAGS here since it will be built as part of
52# _PROGS_COMMON_OBJS and therefore NO_SHARED.$p does not disable ASAN/UBSAN.
53CFLAGS.mini-me.c+=	-fno-sanitize=address -fno-sanitize=undefined
54.endif
55
56BINDIR=	${TESTSDIR}
57
58BINMODE.mini-me.noexec=	${NOBINMODE}
59BINMODE.mini-me.setuid=	4555
60
61WARNS.capsicum-test=	3
62
63.endif # MK_GOOGLETEST
64
65.include <bsd.test.mk>
66