ci(github): ignore profile not handled by this project.
This commit is contained in:
parent
cbea160416
commit
0d43563520
1 changed files with 14 additions and 0 deletions
|
|
@ -6,6 +6,11 @@
|
|||
export BATS_LIB_PATH=${BATS_LIB_PATH:-/usr/lib/bats}
|
||||
load "$BATS_LIB_PATH/bats-support/load"
|
||||
|
||||
export SYSTEMD_PAGER=
|
||||
|
||||
# Ignore the profile not managed by apparmor.d
|
||||
IGNORE=(php-fpm snapd/snap-confine)
|
||||
|
||||
# User password for sudo commands
|
||||
export PASSWORD=${PASSWORD:-user}
|
||||
|
||||
|
|
@ -105,12 +110,21 @@ aa_check() {
|
|||
now=$(date +%s)
|
||||
duration=$((now - _START + 1))
|
||||
logs=$(aa-log --raw --systemd --since "-${duration}s")
|
||||
for profile in "${IGNORE[@]}"; do
|
||||
logs=$(echo "$logs" | grep -v "$profile")
|
||||
done
|
||||
|
||||
aa_start
|
||||
if [[ -n "$logs" ]]; then
|
||||
fail "profile $PROGRAM raised logs: $logs"
|
||||
fi
|
||||
}
|
||||
|
||||
_timeout() {
|
||||
local duration="2s"
|
||||
timeout --preserve-status --kill-after="$duration" "$duration" "$@"
|
||||
}
|
||||
|
||||
# Bats setup and teardown hooks
|
||||
|
||||
setup_file() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue