18ac5aef8SEnji Cooper.include <src.opts.mk> 28ac5aef8SEnji Cooper 38ce99bb4SJohn BaldwinTESTSDIR= ${TESTSBASE}/sys/capsicum 48ce99bb4SJohn Baldwin 52216c693SEd MasteATF_TESTS_C+= bindat_connectat 68ce99bb4SJohn BaldwinATF_TESTS_C+= ioctls_test 78ce99bb4SJohn Baldwin 808e5c473SOlivier CochardCFLAGS+= -I${SRCTOP}/tests 92216c693SEd Maste 108ac5aef8SEnji Cooper.if ${MK_GOOGLETEST} != no 118ac5aef8SEnji Cooper 128ac5aef8SEnji Cooper.PATH: ${SRCTOP}/contrib/capsicum-test 138ac5aef8SEnji Cooper 148ac5aef8SEnji CooperGTESTS+= capsicum-test 15194d5628SLi-Wen HsuGTESTS_WRAPPER_SH.capsicum-test= functional 16*41ece3c0SMark Johnston# This test script runs the same test suite twice, once as root and once as an 17*41ece3c0SMark Johnston# unprivileged user. Serialize them since some tests access global namespaces, 18*41ece3c0SMark Johnston# e.g., mqueuefs, and can trample on each other. 19*41ece3c0SMark JohnstonTEST_METADATA.functional+= is_exclusive="true" 208ac5aef8SEnji Cooper 218ac5aef8SEnji CooperSRCS.capsicum-test+= \ 228ac5aef8SEnji Cooper capsicum-test-main.cc \ 238ac5aef8SEnji Cooper capsicum-test.cc \ 248ac5aef8SEnji Cooper capability-fd.cc \ 2562d3f57cSMariusz Zaborski copy_file_range.cc \ 268ac5aef8SEnji Cooper fexecve.cc \ 278ac5aef8SEnji Cooper procdesc.cc \ 288ac5aef8SEnji Cooper capmode.cc \ 298ac5aef8SEnji Cooper fcntl.cc \ 308ac5aef8SEnji Cooper ioctl.cc \ 318ac5aef8SEnji Cooper openat.cc \ 328ac5aef8SEnji Cooper sysctl.cc \ 338ac5aef8SEnji Cooper select.cc \ 348ac5aef8SEnji Cooper mqueue.cc \ 358ac5aef8SEnji Cooper socket.cc \ 368ac5aef8SEnji Cooper sctp.cc \ 378ac5aef8SEnji Cooper capability-fd-pair.cc \ 388ac5aef8SEnji Cooper overhead.cc \ 398ac5aef8SEnji Cooper rename.cc 408ac5aef8SEnji Cooper 41955a3f9aSAlex RichardsonLIBADD.capsicum-test+= gtest pthread procstat 428ac5aef8SEnji CooperTEST_METADATA.capsicum-test= required_user="unprivileged" 438ac5aef8SEnji Cooper 448ac5aef8SEnji Cooper.for p in mini-me mini-me.noexec mini-me.setuid 458ac5aef8SEnji CooperPROGS+= $p 468ac5aef8SEnji CooperNO_SHARED.$p= 478ac5aef8SEnji CooperSRCS.$p= mini-me.c 488ac5aef8SEnji Cooper.endfor 49c826e088SAlex Richardson.if ${MK_ASAN} != "no" || ${MK_UBSAN} != "no" 50c826e088SAlex Richardson# mini-me.o is linked into a static binary so we can't use sanitizers. 51c826e088SAlex Richardson# Note: We have to set CFLAGS here since it will be built as part of 52c826e088SAlex Richardson# _PROGS_COMMON_OBJS and therefore NO_SHARED.$p does not disable ASAN/UBSAN. 53c826e088SAlex RichardsonCFLAGS.mini-me.c+= -fno-sanitize=address -fno-sanitize=undefined 54c826e088SAlex Richardson.endif 558ac5aef8SEnji Cooper 568ac5aef8SEnji CooperBINDIR= ${TESTSDIR} 578ac5aef8SEnji Cooper 588ac5aef8SEnji CooperBINMODE.mini-me.noexec= ${NOBINMODE} 598ac5aef8SEnji CooperBINMODE.mini-me.setuid= 4555 608ac5aef8SEnji Cooper 618ac5aef8SEnji CooperWARNS.capsicum-test= 3 628ac5aef8SEnji Cooper 63194d5628SLi-Wen Hsu.endif # MK_GOOGLETEST 648ac5aef8SEnji Cooper 658ce99bb4SJohn Baldwin.include <bsd.test.mk> 66