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