1 2.include <src.opts.mk> 3 4TESTSDIR= ${TESTSBASE}/sys/capsicum 5 6ATF_TESTS_C+= bindat_connectat 7ATF_TESTS_C+= ioctls_test 8 9CFLAGS+= -I${SRCTOP}/tests 10 11.if ${MK_GOOGLETEST} != no 12 13.PATH: ${SRCTOP}/contrib/capsicum-test 14 15GTESTS+= capsicum-test 16GTESTS_WRAPPER_SH.capsicum-test= functional 17# This test script runs the same test suite twice, once as root and once as an 18# unprivileged user. Serialize them since some tests access global namespaces, 19# e.g., mqueuefs, and can trample on each other. 20TEST_METADATA.functional+= is_exclusive="true" 21 22SRCS.capsicum-test+= \ 23 capsicum-test-main.cc \ 24 capsicum-test.cc \ 25 capability-fd.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