mirror of https://github.com/containers/podman.git
test/system: speed up podman generate systemd - envar
This container did not react to sigterm thus we always waited 10s for it to stop. Also do not wait 2s for the logs instead use a retry loop. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
15606148e5
commit
1093ebb72b
|
@ -142,14 +142,16 @@ function service_cleanup() {
|
||||||
@test "podman generate systemd - envar" {
|
@test "podman generate systemd - envar" {
|
||||||
cname=$(random_string)
|
cname=$(random_string)
|
||||||
FOO=value BAR=%s run_podman create --name $cname --env FOO -e BAR --env MYVAR=myval \
|
FOO=value BAR=%s run_podman create --name $cname --env FOO -e BAR --env MYVAR=myval \
|
||||||
$IMAGE sh -c 'printenv && sleep 100'
|
$IMAGE sh -c 'printenv && echo READY; trap 'exit' SIGTERM; while :; do sleep 0.1; done'
|
||||||
|
|
||||||
# Start systemd service to run this container
|
# Start systemd service to run this container
|
||||||
service_setup
|
service_setup
|
||||||
|
|
||||||
# Give container time to start; make sure output looks top-like
|
# Give container time to start and print output
|
||||||
sleep 2
|
# wait_for_ready returns directly if the logs matches and preserves $output
|
||||||
run_podman logs $cname
|
# for us so we do not have to call podman logs again here if we match the env below.
|
||||||
|
wait_for_ready $cname
|
||||||
|
|
||||||
is "$output" ".*FOO=value.*" "FOO environment variable set"
|
is "$output" ".*FOO=value.*" "FOO environment variable set"
|
||||||
is "$output" ".*BAR=%s.*" "BAR environment variable set"
|
is "$output" ".*BAR=%s.*" "BAR environment variable set"
|
||||||
is "$output" ".*MYVAR=myval.*" "MYVAL environment variable set"
|
is "$output" ".*MYVAR=myval.*" "MYVAL environment variable set"
|
||||||
|
|
Loading…
Reference in New Issue