Skip to content

Commit

Permalink
ci: run tests on a nftables only system
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Reber <[email protected]>
  • Loading branch information
adrianreber committed Feb 5, 2025
1 parent 08b4743 commit 15df0a2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/nftables-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Nftables bases testing

on: [push, pull_request]

# Cancel any preceding run on the pull request.
concurrency:
group: nftables-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }}

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Remove iptables
run: sudo apt remove -y iptables
- name: Install libnftables-dev
run: sudo scripts/ci/apt-install libnftables-dev
- name: chmod 755 /home/runner
run: sudo chmod 755 /home/runner
- name: Build with nftables network locking backend
run: sudo make -C scripts/ci local COMPILE_FLAGS="NETWORK_LOCK_DEFAULT=NETWORK_LOCK_NFTABLES"
19 changes: 18 additions & 1 deletion scripts/ci/run-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ if [ "${CD_TO_TOP}" = "1" ]; then
fi

export GCOV CC
if [ -z "$COMPILE_FLAGS" ]; then
LOCAL_COMPILE_FLAGS=("V=1")
else
IFS=" " read -r -a LOCAL_COMPILE_FLAGS <<< "$COMPILE_FLAGS"
LOCAL_COMPILE_FLAGS=("V=1" "${LOCAL_COMPILE_FLAGS[@]}")
fi
$CC --version
time make CC="$CC" -j4 V=1
time make CC="$CC" -j4 "${LOCAL_COMPILE_FLAGS[@]}"

./criu/criu -v4 cpuinfo dump || :
./criu/criu -v4 cpuinfo check || :
Expand Down Expand Up @@ -150,6 +156,7 @@ ulimit -c unlimited
cgid=$$
cleanup_cgroup() {
./test/zdtm_umount_cgroups $cgid
dmesg
}
trap cleanup_cgroup EXIT
./test/zdtm_mount_cgroups $cgid
Expand Down Expand Up @@ -205,6 +212,16 @@ chmod 0777 test/
chmod 0777 test/zdtm/static
chmod 0777 test/zdtm/transition

ls -la / || true
ls -la /home || true
ls -la /home/runner || true
ls -la /home/runner/work || true
ls -la /home/runner/work/criu || true
ls -la /home/runner/work/criu/criu || true
ls -la /home/runner/work/criu/criu/test || true
ls -la /home/runner/work/criu/criu/test/zdtm || true
ls -la /home/runner/work/criu/criu/test/zdtm/static || true

# We run streaming tests separately to improve test completion times,
# hence the exit 0.
if [ "${STREAM_TEST}" = "1" ]; then
Expand Down
3 changes: 3 additions & 0 deletions test/others/rpc/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function stop_server {
title_print "Shutdown service server"
kill -SIGTERM $(cat build/pidfile)
unlink build/pidfile
cat build/output* || true
cat build/service.log || true
find . -name "*.log" -exec cat {} \; || true
}

function test_c {
Expand Down

0 comments on commit 15df0a2

Please sign in to comment.