Skip to content

Commit

Permalink
Merge pull request containers#3891 from giuseppe/fix-test-failure-run…
Browse files Browse the repository at this point in the history
…ning-as-root

test: skip rootless on cgroupv2 in root env
  • Loading branch information
openshift-merge-robot authored Apr 4, 2022
2 parents dc6c82e + a6f6a41 commit 7fbf2ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@ function skip_if_rootless_environment() {
fi
}

#################################
# skip_if_root_environment #
#################################
function skip_if_root_environment() {
if ! is_rootless; then
skip "${1:-test is being invoked from root environment}"
fi
}

####################
# skip_if_chroot #
####################
Expand Down
3 changes: 2 additions & 1 deletion tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,9 @@ _EOF
skip_if_no_runtime
skip_if_cgroupsv1
skip_if_in_container
skip_if_root_environment
if test "$DBUS_SESSION_BUS_ADDRESS" = ""; then
skip "${1:-test does not work when \$BUILDAH_ISOLATION = chroot}"
skip "$test does not work when DBUS_SESSION_BUS_ADDRESS is not defined"
fi
_prefetch alpine

Expand Down

0 comments on commit 7fbf2ae

Please sign in to comment.