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

tests/int: runc delete: fix flake, enable for rootless #3392

Merged
merged 1 commit into from
Mar 22, 2022
Merged
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
14 changes: 13 additions & 1 deletion tests/integration/delete.bats
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ function teardown() {
}

@test "runc delete" {
# Need a permission to create a cgroup.
# XXX(@kolyshkin): currently this test does not handle rootless when
# fs cgroup driver is used, because in this case cgroup (with a
# predefined name) is created by tests/rootless.sh, not by runc.
[[ "$ROOTLESS" -ne 0 ]] && requires systemd
set_resources_limit

runc run -d --console-socket "$CONSOLE_SOCKET" testbusyboxdelete
[ "$status" -eq 0 ]

testcontainer testbusyboxdelete running
# Ensure the find statement used later is correct.
output=$(find /sys/fs/cgroup -name testbusyboxdelete -o -name \*-testbusyboxdelete.scope)
if [ -z "$output" ]; then
fail "expected cgroup not found"
fi

runc kill testbusyboxdelete KILL
[ "$status" -eq 0 ]
Expand All @@ -26,7 +38,7 @@ function teardown() {
runc state testbusyboxdelete
[ "$status" -ne 0 ]

output=$(find /sys/fs/cgroup -wholename '*testbusyboxdelete*' -type d)
output=$(find /sys/fs/cgroup -name testbusyboxdelete -o -name \*-testbusyboxdelete.scope)
[ "$output" = "" ] || fail "cgroup not cleaned up correctly: $output"
}

Expand Down