mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
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:
@ -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
|
||||||
|
Reference in New Issue
Block a user