diff --git a/tests/helpers.bash b/tests/helpers.bash index 2bb6b4293ea..c56eee7e5ef 100644 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -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 # #################### diff --git a/tests/run.bats b/tests/run.bats index 3fd5d4ffa7e..e2f3b6d9b95 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -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