diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-14 10:40:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 10:40:34 -0500 |
commit | 2854cdcd5829037a16659b46839b27fd5d58591f (patch) | |
tree | 109d50c4d048c4e2852f2eb654a72e558db6ece0 /test/system/helpers.bash | |
parent | 0fd31e29948631c264df21a128b3de2700f7f007 (diff) | |
parent | 4d7e05f9ba583498abbdef48353b1fa9d8b711f5 (diff) | |
download | podman-2854cdcd5829037a16659b46839b27fd5d58591f.tar.gz podman-2854cdcd5829037a16659b46839b27fd5d58591f.tar.bz2 podman-2854cdcd5829037a16659b46839b27fd5d58591f.zip |
Merge pull request #8714 from edsantiago/more_journald_rootless_skips
RHEL gating tests: more journald exceptions
Diffstat (limited to 'test/system/helpers.bash')
-rw-r--r-- | test/system/helpers.bash | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 6a7c6cc42..f782de080 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -259,6 +259,31 @@ function is_cgroupsv2() { test "$cgroup_type" = "cgroup2fs" } +# rhbz#1895105: rootless journald is unavailable except to users in +# certain magic groups; which our testuser account does not belong to +# (intentional: that is the RHEL default, so that's the setup we test). +function journald_unavailable() { + if ! is_rootless; then + # root must always have access to journal + return 1 + fi + + run journalctl -n 1 + if [[ $status -eq 0 ]]; then + return 1 + fi + + if [[ $output =~ permission ]]; then + return 0 + fi + + # This should never happen; if it does, it's likely that a subsequent + # test will fail. This output may help track that down. + echo "WEIRD: 'journalctl -n 1' failed with a non-permission error:" + echo "$output" + return 1 +} + ########################### # _add_label_if_missing # make sure skip messages include rootless/remote ########################### @@ -315,6 +340,15 @@ function skip_if_cgroupsv1() { fi } +################################## +# skip_if_journald_unavailable # rhbz#1895105: rootless journald permissions +################################## +function skip_if_journald_unavailable { + if journald_unavailable; then + skip "Cannot use rootless journald on this system" + fi +} + ######### # die # Abort with helpful message ######### |