From cc7d41e9e781f344cafa53e6527990b601dd5b53 Mon Sep 17 00:00:00 2001 From: Georgia Garcia Date: Thu, 2 May 2024 13:37:36 +0000 Subject: [PATCH] Merge gitlab-ci.yml: fix pipeline for ubuntu:latest (noble) Since we are using ubuntu:latest, and noble was released, some tests are failing. shellcheck needs python3 to run, which was possibly installed by default in previous ubuntu images and is no longer the case. Ignore dist-packages python files during our coverage tests. Fixes: https://gitlab.com/apparmor/apparmor/-/issues/388 Signed-off-by: Georgia Garcia Closes #388 MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1223 Merged-by: Steve Beattie (cherry picked from commit 8c9ac7a84eeff7bbf49e7bedb6f05be08d1dd6a3) 731880de gitlab-ci.yml: fix pipeline for ubuntu:latest (noble) aaad725a apparmor.systemd: fix shellcheck false positive Co-authored-by: Steve Beattie --- .gitlab-ci.yml | 2 +- parser/apparmor.systemd | 16 ++++++++++++++++ utils/test/Makefile | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f67826cd..7b70ed931 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -112,7 +112,7 @@ shellcheck: extends: - .ubuntu-before_script script: - - apt-get install --no-install-recommends -y file shellcheck xmlstarlet + - apt-get install --no-install-recommends -y python3-minimal file shellcheck xmlstarlet - shellcheck --version - './tests/bin/shellcheck-tree --format=checkstyle | xmlstarlet tr tests/checkstyle2junit.xslt diff --git a/parser/apparmor.systemd b/parser/apparmor.systemd index 09d579245..ccdad3b49 100644 --- a/parser/apparmor.systemd +++ b/parser/apparmor.systemd @@ -17,6 +17,8 @@ APPARMOR_FUNCTIONS=/lib/apparmor/rc.apparmor.functions +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_action() { echo "$1" @@ -25,36 +27,50 @@ aa_action() return $? } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_warning_msg() { echo "Warning: $*" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_failure_msg() { echo "Error: $*" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_action_start() { echo "$@" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_action_end() { printf "" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_daemon_msg() { echo "$@" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_skipped_msg() { echo "Skipped: $*" } +# This function is used in rc.apparmor.functions +# shellcheck disable=SC2317 aa_log_end_msg() { printf "" diff --git a/utils/test/Makefile b/utils/test/Makefile index c86c4256a..c648b939d 100644 --- a/utils/test/Makefile +++ b/utils/test/Makefile @@ -61,7 +61,7 @@ ifndef USE_SYSTEM fi endif -COVERAGE_OMIT=test-*.py,common_test.py +COVERAGE_OMIT=test-*.py,common_test.py,*/dist-packages/* ifneq ($(COVERAGE_OUT), ) HTML_COVR_ARGS=-d $(COVERAGE_OUT) endif