mirror of https://github.com/containers/podman.git
Merge pull request #8714 from edsantiago/more_journald_rootless_skips
RHEL gating tests: more journald exceptions
This commit is contained in:
commit
2854cdcd58
|
@ -415,13 +415,18 @@ json-file | f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $driver != 'none' ]]; then
|
if [[ $driver != 'none' ]]; then
|
||||||
run_podman logs myctr
|
if [[ $driver = 'journald' ]] && journald_unavailable; then
|
||||||
is "$output" "$msg" "check that podman logs works as expected"
|
# Cannot perform check
|
||||||
|
:
|
||||||
|
else
|
||||||
|
run_podman logs myctr
|
||||||
|
is "$output" "$msg" "podman logs, with driver '$driver'"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
run_podman 125 logs myctr
|
run_podman 125 logs myctr
|
||||||
if ! is_remote; then
|
if ! is_remote; then
|
||||||
is "$output" ".*this container is using the 'none' log driver, cannot read logs.*" \
|
is "$output" ".*this container is using the 'none' log driver, cannot read logs.*" \
|
||||||
"podman logs does not work with none log driver"
|
"podman logs, with driver 'none', should fail with error"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
run_podman rm myctr
|
run_podman rm myctr
|
||||||
|
@ -437,14 +442,7 @@ json-file | f
|
||||||
skip_if_remote "We cannot read journalctl over remote."
|
skip_if_remote "We cannot read journalctl over remote."
|
||||||
|
|
||||||
# We can't use journald on RHEL as rootless, either: rhbz#1895105
|
# We can't use journald on RHEL as rootless, either: rhbz#1895105
|
||||||
if is_rootless; then
|
skip_if_journald_unavailable
|
||||||
run journalctl -n 1
|
|
||||||
if [[ $status -ne 0 ]]; then
|
|
||||||
if [[ $output =~ permission ]]; then
|
|
||||||
skip "Cannot use rootless journald on this system"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg=$(random_string 20)
|
msg=$(random_string 20)
|
||||||
pidfile="${PODMAN_TMPDIR}/$(random_string 20)"
|
pidfile="${PODMAN_TMPDIR}/$(random_string 20)"
|
||||||
|
|
|
@ -55,14 +55,7 @@ ${cid[0]} d" "Sequential output from logs"
|
||||||
|
|
||||||
@test "podman logs over journald" {
|
@test "podman logs over journald" {
|
||||||
# We can't use journald on RHEL as rootless: rhbz#1895105
|
# We can't use journald on RHEL as rootless: rhbz#1895105
|
||||||
if is_rootless; then
|
skip_if_journald_unavailable
|
||||||
run journalctl -n 1
|
|
||||||
if [[ $status -ne 0 ]]; then
|
|
||||||
if [[ $output =~ permission ]]; then
|
|
||||||
skip "Cannot use rootless journald on this system"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg=$(random_string 20)
|
msg=$(random_string 20)
|
||||||
|
|
||||||
|
|
|
@ -259,6 +259,31 @@ function is_cgroupsv2() {
|
||||||
test "$cgroup_type" = "cgroup2fs"
|
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
|
# _add_label_if_missing # make sure skip messages include rootless/remote
|
||||||
###########################
|
###########################
|
||||||
|
@ -315,6 +340,15 @@ function skip_if_cgroupsv1() {
|
||||||
fi
|
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
|
# die # Abort with helpful message
|
||||||
#########
|
#########
|
||||||
|
|
Loading…
Reference in New Issue