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 <georgia.garcia@canonical.com>

Closes #388
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1223
Merged-by: Steve Beattie <steve+gitlab@nxnw.org>


(cherry picked from commit 8c9ac7a84e)

731880de gitlab-ci.yml: fix pipeline for ubuntu:latest (noble)
aaad725a apparmor.systemd: fix shellcheck false positive

Co-authored-by: Steve Beattie <steve+gitlab@nxnw.org>
This commit is contained in:
Georgia Garcia 2024-05-02 13:37:53 +00:00
parent 6d1e5dbbe6
commit b7f9b66cba
3 changed files with 18 additions and 2 deletions

View file

@ -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

View file

@ -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 ""

View file

@ -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