Quadlet system test - force journald log driver for short lived containers

When the test expects the container to exit, force using journald in
order to find its startup logs

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum
2023-07-21 11:05:24 +03:00
parent 6156923d85
commit 4b9f670ca2

View File

@ -873,15 +873,13 @@ spec:
- name: $container_name - name: $container_name
image: $IMAGE image: $IMAGE
command: command:
- "sh" - $cmd
args:
- "-c"
- "echo STARTED CONTAINER; $cmd"
EOF EOF
cat > $quadlet_file <<EOF cat > $quadlet_file <<EOF
[Kube] [Kube]
Yaml=$yaml_file Yaml=$yaml_file
ExitCodePropagation=$exit_code_prop ExitCodePropagation=$exit_code_prop
LogDriver=journald
EOF EOF
run_quadlet "$quadlet_file" run_quadlet "$quadlet_file"
@ -892,8 +890,9 @@ EOF
service_setup $QUADLET_SERVICE_NAME service_setup $QUADLET_SERVICE_NAME
# Ensure we have output. # Ensure we have output. Output is synced via sd-notify (socat in Exec)
wait_for_output "STARTED CONTAINER" $pod_name-$container_name run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
is "$output" '.*Started.*\.service.*'
# Opportunistic test: confirm that the Propagation field got set. # Opportunistic test: confirm that the Propagation field got set.
# This is racy, because the container is short-lived and quadlet # This is racy, because the container is short-lived and quadlet