mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 22:35:35 +00:00
Merge branch 'test-includes' into 'master'
profiles/Makefile: test abstractions against apparmor_parser See merge request apparmor/apparmor!237 Acked-by: Christian Boltz <apparmor@cboltz.de> for trunk and 2.13. Pre-acked for 2.10..2.12 after removing the --config-file option which is not supported in these branches.
This commit is contained in:
@@ -29,6 +29,7 @@ DESTDIR=/
|
|||||||
PROFILES_DEST=${DESTDIR}/etc/apparmor.d
|
PROFILES_DEST=${DESTDIR}/etc/apparmor.d
|
||||||
EXTRAS_DEST=${DESTDIR}/usr/share/apparmor/extra-profiles/
|
EXTRAS_DEST=${DESTDIR}/usr/share/apparmor/extra-profiles/
|
||||||
PROFILES_SOURCE=./apparmor.d
|
PROFILES_SOURCE=./apparmor.d
|
||||||
|
ABSTRACTIONS_SOURCE=./apparmor.d/abstractions
|
||||||
EXTRAS_SOURCE=./apparmor/profiles/extras/
|
EXTRAS_SOURCE=./apparmor/profiles/extras/
|
||||||
|
|
||||||
SUBDIRS=$(shell find ${PROFILES_SOURCE} -type d -print)
|
SUBDIRS=$(shell find ${PROFILES_SOURCE} -type d -print)
|
||||||
@@ -84,6 +85,8 @@ docs:
|
|||||||
|
|
||||||
IGNORE_FILES=${EXTRAS_SOURCE}/README
|
IGNORE_FILES=${EXTRAS_SOURCE}/README
|
||||||
CHECK_PROFILES=$(filter-out ${IGNORE_FILES} ${SUBDIRS}, $(wildcard ${PROFILES_SOURCE}/*) $(wildcard ${EXTRAS_SOURCE}/*))
|
CHECK_PROFILES=$(filter-out ${IGNORE_FILES} ${SUBDIRS}, $(wildcard ${PROFILES_SOURCE}/*) $(wildcard ${EXTRAS_SOURCE}/*))
|
||||||
|
# use find because Make wildcard is not recursive:
|
||||||
|
CHECK_ABSTRACTIONS=$(shell find ${ABSTRACTIONS_SOURCE} -type f -print)
|
||||||
|
|
||||||
.PHONY: check
|
.PHONY: check
|
||||||
check: check-parser check-logprof
|
check: check-parser check-logprof
|
||||||
@@ -96,6 +99,14 @@ check-parser: local
|
|||||||
${PARSER} --config-file=../parser/tst/parser.conf -S -b ${PWD}/apparmor.d $${profile} > /dev/null || exit 1; \
|
${PARSER} --config-file=../parser/tst/parser.conf -S -b ${PWD}/apparmor.d $${profile} > /dev/null || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@echo "*** Checking abstractions from ${ABSTRACTIONS_SOURCE} against apparmor_parser"
|
||||||
|
$(Q)for abstraction in ${CHECK_ABSTRACTIONS} ; do \
|
||||||
|
[ -n "${VERBOSE}" ] && echo "Testing $${abstraction}" ; \
|
||||||
|
echo "#include <tunables/global> profile test { #include <$${abstraction}> }" \
|
||||||
|
| ${PARSER} --config-file=../parser/tst/parser.conf -S -b ${PWD}/apparmor.d -I ${PWD} > /dev/null \
|
||||||
|
|| exit 1; \
|
||||||
|
done
|
||||||
|
|
||||||
.PHONY: check-logprof
|
.PHONY: check-logprof
|
||||||
check-logprof: local
|
check-logprof: local
|
||||||
@echo "*** Checking profiles from ${PROFILES_SOURCE} against logprof"
|
@echo "*** Checking profiles from ${PROFILES_SOURCE} against logprof"
|
||||||
|
Reference in New Issue
Block a user