Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/cirrus: fix failures on Centos 9 #3762

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ task:
HOME: /root
CIRRUS_WORKING_DIR: /home/runc
GO_VERSION: "1.19"
BATS_VERSION: "v1.3.0"
BATS_VERSION: "v1.9.0"
RPMS: gcc git iptables jq glibc-static libseccomp-devel make criu fuse-sshfs
# yamllint disable rule:key-duplicates
matrix:
Expand Down Expand Up @@ -104,6 +104,7 @@ task:
centos-stream-9)
dnf config-manager --set-enabled crb # for glibc-static
dnf -y install epel-release epel-next-release # for fuse-sshfs
dnf -y update
;;
esac
# Work around dnf mirror failures by retrying a few times.
Expand Down Expand Up @@ -158,8 +159,6 @@ task:
/home/runc/script/check-config.sh
unit_tests_script: |
ssh -tt localhost "make -C /home/runc localunittest"
integration_systemd_script: |
ssh -tt localhost "make -C /home/runc localintegration RUNC_USE_SYSTEMD=yes"
integration_fs_script: |
ssh -tt localhost "make -C /home/runc localintegration"
integration_systemd_rootless_script: |
Expand All @@ -173,3 +172,5 @@ task:
ssh -tt localhost "make -C /home/runc localrootlessintegration"
;;
esac
integration_systemd_script: |
ssh -tt localhost "make -C /home/runc localintegration RUNC_USE_SYSTEMD=yes"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG GO_VERSION=1.19
ARG BATS_VERSION=v1.3.0
ARG BATS_VERSION=v1.9.0
ARG LIBSECCOMP_VERSION=2.5.4

FROM golang:${GO_VERSION}-bullseye
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,15 @@ function teardown_bundle() {
__runc delete -f "$ct"
done
rm -rf "$ROOT"
# Check that systemd unit is removed.
if [ -v RUNC_USE_SYSTEMD ]; then
run systemctl status runc-test_busybox.scope
echo "$output"
[ "$status" -eq 4 ] # "no such unit"
if ls /run/systemd/transient/runc-test_busybox.scope.d; then
fail "should not have test_busybox left"
fi
fi
remove_parent
}

Expand Down
46 changes: 23 additions & 23 deletions tests/integration/ps.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ load helpers

function setup() {
setup_busybox
id=test_busybox
#id=ct-${RANDOM}
# if [ -v RUNC_USE_SYSTEMD ]; then
# update_config '.linux.cgroupsPath |= ":runc:test_busybox-'${RANDOM}'"'
# fi
}

function teardown() {
Expand All @@ -14,14 +19,13 @@ function teardown() {
# ps is not supported, it requires cgroups
requires root

# start busybox detached
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
systemctl status runc-test_busybox.scope || true
runc run -d --console-socket "$CONSOLE_SOCKET" $id
[ "$status" -eq 0 ]

# check state
testcontainer test_busybox running
testcontainer $id running

runc ps test_busybox
runc ps $id
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ UID\ +PID\ +PPID\ +C\ +STIME\ +TTY\ +TIME\ +CMD+ ]]
[[ "${lines[1]}" == *"$(id -un 2>/dev/null)"*[0-9]* ]]
Expand All @@ -31,14 +35,13 @@ function teardown() {
# ps is not supported, it requires cgroups
requires root

# start busybox detached
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
systemctl status runc-test_busybox.scope || true
runc run -d --console-socket "$CONSOLE_SOCKET" $id
[ "$status" -eq 0 ]

# check state
testcontainer test_busybox running
testcontainer $id running

runc ps -f json test_busybox
runc ps -f json $id
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ [0-9]+ ]]
}
Expand All @@ -47,14 +50,13 @@ function teardown() {
# ps is not supported, it requires cgroups
requires root

# start busybox detached
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
systemctl status runc-test_busybox.scope || true
runc run -d --console-socket "$CONSOLE_SOCKET" $id
[ "$status" -eq 0 ]

# check state
testcontainer test_busybox running
testcontainer $id running

runc ps test_busybox -e -x
runc ps $id -e -x
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ \ +PID\ +TTY\ +STAT\ +TIME\ +COMMAND+ ]]
[[ "${lines[1]}" =~ [0-9]+ ]]
Expand All @@ -65,20 +67,18 @@ function teardown() {
[ $EUID -ne 0 ] && requires rootless_cgroup
set_cgroups_path

# start busybox detached
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
runc run -d --console-socket "$CONSOLE_SOCKET" $id
[ "$status" -eq 0 ]

# check state
testcontainer test_busybox running
testcontainer $id running

runc ps test_busybox
runc ps $id
[ "$status" -eq 0 ]

runc kill test_busybox KILL
runc kill $id KILL
[ "$status" -eq 0 ]
wait_for_container 10 1 test_busybox stopped
wait_for_container 10 1 $id stopped

runc ps test_busybox
runc ps $id
[ "$status" -eq 0 ]
}
1 change: 1 addition & 0 deletions tests/integration/update.bats
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ EOF
done

# test update other option won't impact on cpu.idle
check_cgroup_value "cpu.idle" "1"
runc update --cpu-period 10000 test_update
[ "$status" -eq 0 ]
check_cgroup_value "cpu.idle" "1"
Expand Down