diff --git a/tests/integration/help.bats b/tests/integration/help.bats index c512d7a9e..04bbc80cf 100644 --- a/tests/integration/help.bats +++ b/tests/integration/help.bats @@ -2,6 +2,13 @@ load helpers +function setup() { + # It does not make sense to repeat these trivial tests for non-root. + # Also, they fail due to $ROOT not being set and XDG_RUNTIME_DIR + # pointing to another user's directory after sudo rootless. + requires root +} + @test "runc -h" { runc -h [ "$status" -eq 0 ] diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 91cd9967c..bc6bf4b98 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -54,7 +54,8 @@ function runc() { # Raw wrapper for runc. function __runc() { - "$RUNC" ${RUNC_USE_SYSTEMD+--systemd-cgroup} --root "$ROOT/state" "$@" + "$RUNC" ${RUNC_USE_SYSTEMD+--systemd-cgroup} \ + ${ROOT:+--root "$ROOT/state"} "$@" } # Wrapper for runc spec.