diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-25 08:09:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 08:09:03 -0400 |
commit | d09259a1a754ab08c74b13272882a89b5c736e88 (patch) | |
tree | 4ce6b86bc2cf17da0e1b84c4c01beeeb0164fd54 /test | |
parent | 8809aed5647b61abb14970d409ff7c99c7fbdc34 (diff) | |
parent | 822818287596c53a1b499d4fbd7cd1e8a60098a4 (diff) | |
download | podman-d09259a1a754ab08c74b13272882a89b5c736e88.tar.gz podman-d09259a1a754ab08c74b13272882a89b5c736e88.tar.bz2 podman-d09259a1a754ab08c74b13272882a89b5c736e88.zip |
Merge pull request #11320 from vrothberg/3.3-fix-11304
[3.3] generate systemd: use --cidfile again
Diffstat (limited to 'test')
-rw-r--r-- | test/system/250-systemd.bats | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index ee951ff21..5d4ae4cb1 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -46,11 +46,20 @@ function service_setup() { # Helper to stop a systemd service running a container function service_cleanup() { + local status=$1 run systemctl stop "$SERVICE_NAME" if [ $status -ne 0 ]; then die "Error stopping systemd unit $SERVICE_NAME, output: $output" fi + if [[ -z "$status" ]]; then + run systemctl is-active "$SERVICE_NAME" + if [ $status -ne 0 ]; then + die "Error checking stauts of systemd unit $SERVICE_NAME, output: $output" + fi + is "$output" "$status" "$SERVICE_NAME not in expected state" + fi + rm -f "$UNIT_FILE" systemctl daemon-reload } @@ -60,7 +69,8 @@ function service_cleanup() { @test "podman generate - systemd - basic" { cname=$(random_string) # See #7407 for --pull=always. - run_podman create --pull=always --name $cname --label "io.containers.autoupdate=registry" $IMAGE top + run_podman create --pull=always --name $cname --label "io.containers.autoupdate=registry" $IMAGE \ + sh -c "trap 'echo Received SIGTERM, finishing; exit' SIGTERM; echo WAITING; while :; do sleep 0.1; done" # Start systemd service to run this container service_setup @@ -68,7 +78,7 @@ function service_cleanup() { # Give container time to start; make sure output looks top-like sleep 2 run_podman logs $cname - is "$output" ".*Load average:.*" "running container 'top'-like output" + is "$output" ".*WAITING.*" "running is waiting for signal" # Exercise `podman auto-update`. # TODO: this will at least run auto-update code but won't perform an update @@ -77,7 +87,8 @@ function service_cleanup() { run_podman auto-update # All good. Stop service, clean up. - service_cleanup + # Also make sure the service is in the `inactive` state (see #11304). + service_cleanup inactive } @test "podman autoupdate local" { |