diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/12-imagesMore.at | 2 | ||||
-rw-r--r-- | test/apiv2/20-containers.at | 8 | ||||
-rw-r--r-- | test/apiv2/22-stop.at | 4 | ||||
-rw-r--r-- | test/apiv2/25-containersMore.at | 4 | ||||
-rw-r--r-- | test/apiv2/python/rest_api/test_v2_0_0_container.py | 2 | ||||
-rwxr-xr-x | test/buildah-bud/apply-podman-deltas | 10 | ||||
-rw-r--r-- | test/system/001-basic.bats | 2 | ||||
-rw-r--r-- | test/system/030-run.bats | 15 | ||||
-rw-r--r-- | test/system/050-stop.bats | 5 | ||||
-rw-r--r-- | test/system/055-rm.bats | 12 | ||||
-rw-r--r-- | test/system/080-pause.bats | 3 | ||||
-rw-r--r-- | test/system/170-run-userns.bats | 16 | ||||
-rw-r--r-- | test/system/200-pod.bats | 6 | ||||
-rw-r--r-- | test/system/250-systemd.bats | 5 | ||||
-rw-r--r-- | test/system/500-networking.bats | 6 |
15 files changed, 84 insertions, 16 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at index 3a5d5c096..96eba1db5 100644 --- a/test/apiv2/12-imagesMore.at +++ b/test/apiv2/12-imagesMore.at @@ -53,7 +53,7 @@ t GET libpod/images/$IMAGE/json 200 \ .RepoTags[-1]=$IMAGE # Remove the registry container -t DELETE libpod/containers/registry?force=true 204 +t DELETE libpod/containers/registry?force=true 200 # Remove images t DELETE libpod/images/$IMAGE 200 \ diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 554a905d4..936597f72 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -85,7 +85,7 @@ else fi fi -t DELETE libpod/containers/$cid 204 +t DELETE libpod/containers/$cid 200 .[0].Id=$cid # Issue #6799: it should be possible to start a container, even w/o args. t POST libpod/containers/create?name=test_noargs Image=${IMAGE} 201 \ @@ -100,7 +100,7 @@ t GET libpod/containers/${cid}/json 200 \ .State.Status~\\\(exited\\\|stopped\\\) \ .State.Running=false \ .State.ExitCode=0 -t DELETE libpod/containers/$cid 204 +t DELETE libpod/containers/$cid 200 .[0].Id=$cid CNAME=myfoo podman run -d --name $CNAME $IMAGE top @@ -190,8 +190,8 @@ t GET containers/myctr/json 200 \ t DELETE images/localhost/newrepo:latest?force=true 200 t DELETE images/localhost/newrepo:v1?force=true 200 t DELETE images/localhost/newrepo:v2?force=true 200 -t DELETE libpod/containers/$cid?force=true 204 -t DELETE libpod/containers/myctr 204 +t DELETE libpod/containers/$cid?force=true 200 .[0].Id=$cid +t DELETE libpod/containers/myctr 200 t DELETE libpod/containers/bogus 404 diff --git a/test/apiv2/22-stop.at b/test/apiv2/22-stop.at index 91bc9937d..bde534b72 100644 --- a/test/apiv2/22-stop.at +++ b/test/apiv2/22-stop.at @@ -11,7 +11,7 @@ podman run -dt --name mytop $IMAGE top &>/dev/null t GET libpod/containers/mytop/json 200 .State.Status=running t POST libpod/containers/mytop/stop 204 t GET libpod/containers/mytop/json 200 .State.Status~\\\(exited\\\|stopped\\\) -t DELETE libpod/containers/mytop 204 +t DELETE libpod/containers/mytop 200 # stop, by ID # Remember that podman() hides all output; we need to get our CID via inspect @@ -21,4 +21,4 @@ t GET libpod/containers/mytop/json 200 .State.Status=running cid=$(jq -r .Id <<<"$output") t POST libpod/containers/$cid/stop 204 t GET libpod/containers/mytop/json 200 .State.Status~\\\(exited\\\|stopped\\\) -t DELETE libpod/containers/mytop 204 +t DELETE libpod/containers/mytop 200 diff --git a/test/apiv2/25-containersMore.at b/test/apiv2/25-containersMore.at index 0a049d869..c9fda8c6f 100644 --- a/test/apiv2/25-containersMore.at +++ b/test/apiv2/25-containersMore.at @@ -51,7 +51,7 @@ like "$output" ".*merged" "Check container mount" # Unmount the container t POST libpod/containers/foo/unmount 204 -t DELETE libpod/containers/foo?force=true 204 +t DELETE libpod/containers/foo?force=true 200 podman run $IMAGE true @@ -79,7 +79,7 @@ like "$output" ".*metadata:.*" "Check generated kube yaml(service=true) - metada like "$output" ".*spec:.*" "Check generated kube yaml(service=true) - spec" like "$output" ".*kind:\\sService.*" "Check generated kube yaml(service=true) - kind: Service" -t DELETE libpod/containers/$cid 204 +t DELETE libpod/containers/$cid 200 .[0].Id=$cid # Create 3 stopped containers to test containers prune podman run $IMAGE true diff --git a/test/apiv2/python/rest_api/test_v2_0_0_container.py b/test/apiv2/python/rest_api/test_v2_0_0_container.py index 101044bbb..1b4597cf8 100644 --- a/test/apiv2/python/rest_api/test_v2_0_0_container.py +++ b/test/apiv2/python/rest_api/test_v2_0_0_container.py @@ -99,7 +99,7 @@ class ContainerTestCase(APITestCase): def test_delete(self): r = requests.delete(self.uri(self.resolve_container("/containers/{}?force=true"))) - self.assertEqual(r.status_code, 204, r.text) + self.assertEqual(r.status_code, 200, r.text) def test_stop(self): r = requests.post(self.uri(self.resolve_container("/containers/{}/start"))) diff --git a/test/buildah-bud/apply-podman-deltas b/test/buildah-bud/apply-podman-deltas index 44a33b0b8..e42c8aa52 100755 --- a/test/buildah-bud/apply-podman-deltas +++ b/test/buildah-bud/apply-podman-deltas @@ -191,6 +191,16 @@ skip_if_remote "--stdin option will not be implemented in podman-remote" \ # BEGIN tests which are skipped due to actual podman-remote bugs. ############################################################################### +# BEGIN emergency handling of github git-protocol shutdown +# +# Please remove this as soon as we vendor buildah with #3701 + +skip "emergency workaround until buildah #3701 gets vendored in" \ + "bud-git-context" \ + "bud using gitrepo and branch" + +# END emergency handling of github git-protocol shutdown +############################################################################### # Done. exit $RC diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats index 23489c1b5..9b0a71285 100644 --- a/test/system/001-basic.bats +++ b/test/system/001-basic.bats @@ -41,7 +41,7 @@ function setup() { # This one must fail run_podman 125 --context=swarm version is "$output" \ - "Error: Podman does not support swarm, the only --context value allowed is \"default\"" \ + "Error: podman does not support swarm, the only --context value allowed is \"default\"" \ "--context=default or fail" } diff --git a/test/system/030-run.bats b/test/system/030-run.bats index feca5370b..afcda3d3c 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -509,6 +509,21 @@ json-file | f rm -f $new_runtime } +@test "podman --noout run should print output" { + run_podman --noout run -d --name test $IMAGE echo hi + is "$output" "" "output should be empty" + run_podman wait test + run_podman --noout rm test + is "$output" "" "output should be empty" +} + +@test "podman --noout create should print output" { + run_podman --noout create --name test $IMAGE echo hi + is "$output" "" "output should be empty" + run_podman --noout rm test + is "$output" "" "output should be empty" +} + # Regression test for issue #8082 @test "podman run : look up correct image name" { # Create a 2nd tag for the local image. Force to lower case, and apply it. diff --git a/test/system/050-stop.bats b/test/system/050-stop.bats index e049da518..7dd8f98e8 100644 --- a/test/system/050-stop.bats +++ b/test/system/050-stop.bats @@ -173,4 +173,9 @@ load helpers is "$output" ".*StopSignal SIGTERM failed to stop container stopme in 1 seconds, resorting to SIGKILL" "stopping container should print warning" } +@test "podman stop --noout" { + run_podman run --rm --name stopme -d $IMAGE top + run_podman --noout stop -t 0 stopme + is "$output" "" "output should be empty" +} # vim: filetype=sh diff --git a/test/system/055-rm.bats b/test/system/055-rm.bats index 7fe81c084..69663fafa 100644 --- a/test/system/055-rm.bats +++ b/test/system/055-rm.bats @@ -58,6 +58,18 @@ load helpers run_podman rm -af } +@test "podman rm --depend" { + run_podman create $IMAGE + dependCid=$output + run_podman create --net=container:$dependCid $IMAGE + cid=$output + run_podman 125 rm $dependCid + is "$output" "Error: container $dependCid has dependent containers which must be removed before it:.*" "Fail to remove because of dependencies" + run_podman rm --depend $dependCid + is "$output" ".*$cid" "Container should have been removed" + is "$output" ".*$dependCid" "Depend container should have been removed" +} + # I'm sorry! This test takes 13 seconds. There's not much I can do about it, # please know that I think it's justified: podman 1.5.0 had a strange bug # in with exit status was not preserved on some code paths with 'rm -f' diff --git a/test/system/080-pause.bats b/test/system/080-pause.bats index 857c8bbf4..57f390a74 100644 --- a/test/system/080-pause.bats +++ b/test/system/080-pause.bats @@ -21,7 +21,8 @@ load helpers # time to write a new post-restart time value. Pause by CID, unpause # by name, just to exercise code paths. While paused, check 'ps' # and 'inspect', then check again after restarting. - run_podman pause $cid + run_podman --noout pause $cid + is "$output" "" "output should be empty" run_podman inspect --format '{{.State.Status}}' $cid is "$output" "paused" "podman inspect .State.Status" sleep 3 diff --git a/test/system/170-run-userns.bats b/test/system/170-run-userns.bats index a5be591ef..c020a73ab 100644 --- a/test/system/170-run-userns.bats +++ b/test/system/170-run-userns.bats @@ -78,3 +78,19 @@ EOF # Then check that the main user is not mapped into the user namespace CONTAINERS_CONF=$PODMAN_TMPDIR/userns_auto.conf run_podman 0 run --rm $IMAGE awk '{if($2 == "0"){exit 1}}' /proc/self/uid_map /proc/self/gid_map } + +@test "podman userns=auto and secrets" { + ns_user="containers" + if is_rootless; then + ns_user=$(id -un) + fi + egrep -q "${ns_user}:" /etc/subuid || skip "no IDs allocated for user ${ns_user}" + test_name="test_$(random_string 12)" + secret_file=$PODMAN_TMPDIR/secret$(random_string 12) + secret_content=$(random_string) + echo ${secret_content} > ${secret_file} + run_podman secret create ${test_name} ${secret_file} + run_podman run --rm --secret=${test_name} --userns=auto:size=1000 $IMAGE cat /run/secrets/${test_name} + is ${output} ${secret_content} "Secrets should work with user namespace" + run_podman secret rm ${test_name} +} diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats index 6abdf9779..4a3337e57 100644 --- a/test/system/200-pod.bats +++ b/test/system/200-pod.bats @@ -57,7 +57,8 @@ function teardown() { fi # Clean up - run_podman pod rm -f -t 0 $podid + run_podman --noout pod rm -f -t 0 $podid + is "$output" "" "output should be empty" } @@ -330,7 +331,8 @@ EOF # Note that the internal pause image is built even when --infra-image is # set to the K8s one. - run_podman pod create --name $pod_name --infra-name "$infra_name" --infra-image "k8s.gcr.io/pause:3.5" + run_podman --noout pod create --name $pod_name --infra-name "$infra_name" --infra-image "k8s.gcr.io/pause:3.5" + is "$output" "" "output should be empty" run_podman '?' pod create --infra-name "$infra_name" if [ $status -eq 0 ]; then die "Podman should fail when user try to create two pods with the same infra-name value" diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index c49727cc9..c47679904 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -276,4 +276,9 @@ LISTEN_FDNAMES=listen_fdnames" | sort) is "$output" ".*--template cannot be set" "Error message should be '--template requires --new'" } +@test "podman --cgroup=cgroupfs doesn't show systemd warning" { + DBUS_SESSION_BUS_ADDRESS= run_podman --log-level warning --cgroup-manager=cgroupfs info -f '' + is "$output" "" "output should be empty" +} + # vim: filetype=sh diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 2b5ad44dc..5a721c965 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -332,7 +332,8 @@ load helpers is_rootless || skip "only meaningful for rootless" local mynetname=testnet-$(random_string 10) - run_podman network create $mynetname + run_podman --noout network create $mynetname + is "$output" "" "output should be empty" # Test that rootless cni adds /usr/sbin to $PATH # iptables is located under /usr/sbin and is needed for the CNI plugins. @@ -340,7 +341,8 @@ load helpers PATH=/usr/local/bin:/usr/bin run_podman run --rm --network $mynetname $IMAGE ip addr is "$output" ".*eth0.*" "Interface eth0 not found in ip addr output" - run_podman network rm -t 0 -f $mynetname + run_podman --noout network rm -t 0 -f $mynetname + is "$output" "" "output should be empty" } @test "podman ipv6 in /etc/resolv.conf" { |