summaryrefslogtreecommitdiff
path: root/test/system/helpers.bash
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-12-14 06:40:46 -0700
committerEd Santiago <santiago@redhat.com>2020-12-14 06:40:46 -0700
commit4d7e05f9ba583498abbdef48353b1fa9d8b711f5 (patch)
tree615c42b130ffbc018077e6dd2c3eea3e858826c1 /test/system/helpers.bash
parenta226e6ed318ae7b7af16081b787cc80718e73e2d (diff)
downloadpodman-4d7e05f9ba583498abbdef48353b1fa9d8b711f5.tar.gz
podman-4d7e05f9ba583498abbdef48353b1fa9d8b711f5.tar.bz2
podman-4d7e05f9ba583498abbdef48353b1fa9d8b711f5.zip
RHEL gating tests: more journald exceptions
Followup to #8284, due to my not having noticed #8096. RHEL gating tests are failing again due to rhbz#1895105, the one where we can't run journalctl rootless on RHEL. #8284 fixed this for some RHEL builds of older podman, but I missed #8096 which added yet another logs test. This brings us to three journalctl exceptions, which means it gets complicated because I have to refactor it all. **THIS IS NOT SUSTAINABLE**. We need some way to have a similar setup in CI, with a permission-less rootless login, so we don't add yet another logs test some day and discover, months later, that it doesn't work on RHEL and then have to go into crisis mode. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/helpers.bash')
-rw-r--r--test/system/helpers.bash34
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
#########