Skip to content

Commit

Permalink
tests/journal-compat: work around ubi8 image being untrusted
Browse files Browse the repository at this point in the history
There's a messy situation right now with the default `policy.json`
shipped by `containers-common` and the RHEL keys missing from the c9s
compose.

This is tracked at openshift#1505. But this
test is totally unrelated to all this. So let's work around it for now
to unblock CI.
  • Loading branch information
jlebon committed May 8, 2024
1 parent 8644a08 commit 33cc766
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/kola/systemd/journal-compat
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ set -euo pipefail

cd $(mktemp -d)

if is_scos; then
# work around https://github.com/openshift/os/issues/1505
cat > /etc/containers/policy.json <<EOF
{
"default": [{"type": "insecureAcceptAnything"}]
}
EOF
fi

# The string Linux should match the kernel boot
podman run --privileged --net=none -v /var/log:/var/log:ro --rm registry.access.redhat.com/ubi8/ubi:latest journalctl -D /var/log/journal --grep="Linux" > journal.txt 2>err.txt
rc=0
podman run --privileged --net=none -v /var/log:/var/log:ro --rm registry.access.redhat.com/ubi8/ubi:latest journalctl -D /var/log/journal --grep="Linux" > journal.txt 2>err.txt || rc=$?
if [ "$rc" != 0 ]; then
cat err.txt
fatal "podman run exited with rc=$rc"
fi
if grep -qF 'uses an unsupported feature' err.txt; then
fatal "Got unsupported feature trying to read journal"
fi
Expand Down

0 comments on commit 33cc766

Please sign in to comment.