Skip to content

Commit

Permalink
test/system: podman play --service-container slog to syslog
Browse files Browse the repository at this point in the history
In theory when syslog is set the cleanup process should log its errors
to syslog (journald) so we can have a look at the errors in CI.
Without it podman container cleanup errors will never be logged anywhere.

In order to rey to debug  containers#21569

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 authored and edsantiago committed Nov 6, 2024
1 parent 29cfbf5 commit b206dd6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/system/700-play.bats
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ RELABEL="system_u:object_r:container_file_t:s0"

# Run `play kube` in the background as it will wait for the service
# container to exit.
log=/tmp/podman-kube-bg.log
timeout --foreground -v --kill=10 60 \
$PODMAN play kube --service-container=true --log-driver journald $TESTYAML &>$log &
$PODMAN --syslog play kube --service-container=true --log-driver journald $TESTYAML &>/dev/null &

# Wait for the container to be running
container_a=$PODCTRNAME
Expand Down Expand Up @@ -201,7 +200,7 @@ RELABEL="system_u:object_r:container_file_t:s0"
is "$output" "true"

# Restart the pod, make sure the service is running again
run_podman pod restart $PODNAME
run_podman --syslog pod restart $PODNAME
run_podman container inspect $service_container --format "{{.State.Running}}"
is "$output" "true"

Expand All @@ -212,17 +211,13 @@ RELABEL="system_u:object_r:container_file_t:s0"
is "$output" "Error: container .* is the service container of pod(s) .* and cannot be removed without removing the pod(s)"

# Kill the pod and make sure the service is not running
run_podman pod kill $PODNAME
run_podman --syslog pod kill $PODNAME
_ensure_container_running $service_container false

echo
echo "cat $log:"
cat $log
echo
run_podman network ls

# Remove the pod and make sure the service is removed along with it
run_podman pod rm $PODNAME
run_podman --syslog pod rm $PODNAME
run_podman 1 container exists $service_container
}

Expand Down

0 comments on commit b206dd6

Please sign in to comment.