summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-09-25 15:40:39 +0100
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-09-27 12:22:22 +0100
commit8b036b223a40fac9e53189db05d3798ec11eb475 (patch)
tree454602e105c8e9be08f933b56a8849eade28e07c
parent059c0578d7e648ef19f624d471bb93c4db75f9dd (diff)
downloadsystemd-8b036b223a40fac9e53189db05d3798ec11eb475.tar.gz
CI: run unit tests in a network namespace
It seems some of the tests break network connectivity on the host, as the code coverage upload fails to establish a connection. Run them in a network namespace with 'unshare -n'.
-rwxr-xr-x.github/workflows/unit_tests.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh
index e85c321001..f661d45c99 100755
--- a/.github/workflows/unit_tests.sh
+++ b/.github/workflows/unit_tests.sh
@@ -6,6 +6,7 @@ ADDITIONAL_DEPS=(
clang
expect
fdisk
+ iproute2
jekyll
libfdisk-dev
libfido2-dev
@@ -18,6 +19,7 @@ ADDITIONAL_DEPS=(
perl
python3-libevdev
python3-pyparsing
+ util-linux
zstd
)
@@ -45,7 +47,8 @@ for phase in "${PHASES[@]}"; do
fi
meson --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true -Dman=true build
ninja -C build -v
- meson test -C build --print-errorlogs
+ # Some of the unsafe tests irreparably break the host's network connectivity, so run them in a namespace
+ unshare -n bash -c 'ip link set dev lo up; meson test -C build --print-errorlogs'
;;
RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN)
MESON_ARGS=(--optimization=1)
@@ -74,7 +77,7 @@ for phase in "${PHASES[@]}"; do
# during debugging, wonderful), so let's at least keep a workaround
# here to make the builds stable for the time being.
(set +x; while :; do echo -ne "\n[WATCHDOG] $(date)\n"; sleep 30; done) &
- meson test --timeout-multiplier=3 -C build --print-errorlogs
+ unshare -n bash -c 'ip link set dev lo up; meson test --timeout-multiplier=3 -C build --print-errorlogs'
;;
CLEANUP)
info "Cleanup phase"