diff options
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/045-start.bats | 43 | ||||
-rwxr-xr-x | test/system/build-testimage | 6 | ||||
-rw-r--r-- | test/system/helpers.bash | 4 |
3 files changed, 48 insertions, 5 deletions
diff --git a/test/system/045-start.bats b/test/system/045-start.bats new file mode 100644 index 000000000..ff818e51d --- /dev/null +++ b/test/system/045-start.bats @@ -0,0 +1,43 @@ +#!/usr/bin/env bats -*- bats -*- + +load helpers + +@test "podman start --all - start all containers" { + # Run a bunch of short-lived containers, with different --restart settings + run_podman run -d $IMAGE /bin/true + cid_none_implicit="$output" + run_podman run -d --restart=no $IMAGE /bin/false + cid_none_explicit="$output" + run_podman run -d --restart=on-failure $IMAGE /bin/true + cid_on_failure="$output" + + # Run one longer-lived one. + run_podman run -d --restart=always $IMAGE sleep 20 + cid_always="$output" + + run_podman wait $cid_none_implicit $cid_none_explicit $cid_on_failure + + run_podman start --all + is "$output" ".*$cid_none_implicit" "started: container with no --restart" + is "$output" ".*$cid_none_explicit" "started: container with --restart=no" + is "$output" ".*$cid_on_failure" "started: container with --restart=on-failure" + if [[ $output =~ $cid_always ]]; then + die "podman start --all restarted a running container" + fi + + run_podman rm $cid_none_implicit $cid_none_explicit $cid_on_failure + run_podman stop -t 1 $cid_always + run_podman rm $cid_always +} + +@test "podman start --all with incompatible options" { + expected="Error: either start all containers or the container(s) provided in the arguments" + run_podman 125 start --all 12333 + is "$output" "$expected" "start --all, with args, throws error" + if ! is_remote; then + run_podman 125 start --all --latest + is "$output" "$expected" "podman start --all --latest" + fi +} + +# vim: filetype=sh diff --git a/test/system/build-testimage b/test/system/build-testimage index aac08e307..3e5b982ce 100755 --- a/test/system/build-testimage +++ b/test/system/build-testimage @@ -78,7 +78,7 @@ podman rmi -f testimage &> /dev/null || true # and because Dan says arch emulation is not currently working on podman # (no further details). # Arch emulation on Fedora requires the qemu-user-static package. -for arch in amd64 ppc64le s390x;do +for arch in amd64 arm64v8 ppc64le s390x;do ${BUILDAH} bud \ --arch=$arch \ --build-arg ARCH=$arch \ @@ -106,9 +106,9 @@ ${BUILDAH} manifest push --all ${remote_tag} docker://${remote_tag} # As of 2021-02-24 it is simply busybox, because it is super small, # but it's complicated because of multiarch: # -# img=quay.io/libpod/testimage:00000001 +# img=quay.io/libpod/testimage:0000000<current+1> # buildah manifest create $img -# for arch in amd64 ppc64le s390x;do +# for arch in amd64 arm64v8 ppc64le s390x;do # buildah pull --arch $arch docker.io/$arch/busybox:1.32.0 # buildah manifest add $img docker.io/$arch/busybox:1.32.0 # done diff --git a/test/system/helpers.bash b/test/system/helpers.bash index b109248ff..e0c208f57 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -7,14 +7,14 @@ PODMAN=${PODMAN:-podman} PODMAN_TEST_IMAGE_REGISTRY=${PODMAN_TEST_IMAGE_REGISTRY:-"quay.io"} PODMAN_TEST_IMAGE_USER=${PODMAN_TEST_IMAGE_USER:-"libpod"} PODMAN_TEST_IMAGE_NAME=${PODMAN_TEST_IMAGE_NAME:-"testimage"} -PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20210223"} +PODMAN_TEST_IMAGE_TAG=${PODMAN_TEST_IMAGE_TAG:-"20210427"} PODMAN_TEST_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:$PODMAN_TEST_IMAGE_TAG" PODMAN_TEST_IMAGE_ID= # Remote image that we *DO NOT* fetch or keep by default; used for testing pull # This changed from 0 to 1 on 2021-02-24 due to multiarch considerations; it # should change only very rarely. -PODMAN_NONLOCAL_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:00000001" +PODMAN_NONLOCAL_IMAGE_FQN="$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME:00000002" # Because who wants to spell that out each time? IMAGE=$PODMAN_TEST_IMAGE_FQN |