From 0d43563520ba8ae72b887d737e26af4069ebce80 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Sun, 30 Mar 2025 21:29:28 +0200 Subject: [PATCH] ci(github): ignore profile not handled by this project. --- tests/integration/common.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/common.bash b/tests/integration/common.bash index 556ef871b..ed167d4f9 100644 --- a/tests/integration/common.bash +++ b/tests/integration/common.bash @@ -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() {