diff options
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/010-images.bats | 7 | ||||
-rw-r--r-- | test/system/030-run.bats | 16 | ||||
-rw-r--r-- | test/system/055-rm.bats | 7 | ||||
-rw-r--r-- | test/system/160-volumes.bats | 7 | ||||
-rw-r--r-- | test/system/200-pod.bats | 7 | ||||
-rw-r--r-- | test/system/500-networking.bats | 9 |
6 files changed, 52 insertions, 1 deletions
diff --git a/test/system/010-images.bats b/test/system/010-images.bats index 638910302..aa390f236 100644 --- a/test/system/010-images.bats +++ b/test/system/010-images.bats @@ -317,4 +317,11 @@ Deleted: $pauseID" is "$output" "" } +@test "podman image rm --force bogus" { + run_podman 1 image rm bogus + is "$output" "Error: bogus: image not known" "Should print error" + run_podman image rm --force bogus + is "$output" "" "Should print no output" +} + # vim: filetype=sh diff --git a/test/system/030-run.bats b/test/system/030-run.bats index b3e3cef00..39ff3fcd4 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -853,4 +853,20 @@ EOF run_podman rm $output } +@test "podman run failed --rm " { + port=$(random_free_port) + + # Run two containers with the same port bindings. The second must fail + run_podman run -p $port:80 --rm -d --name c_ok $IMAGE top + run_podman 126 run -p $port:80 -d --name c_fail_no_rm $IMAGE top + run_podman 126 run -p $port:80 --rm -d --name c_fail_with_rm $IMAGE top + # Prior to #15060, the third container would still show up in ps -a + run_podman ps -a --sort names --format '{{.Image}}--{{.Names}}' + is "$output" "$IMAGE--c_fail_no_rm +$IMAGE--c_ok" \ + "podman ps -a shows running & failed containers, but not failed-with-rm" + + run_podman container rm -f -t 0 c_ok c_fail_no_rm +} + # vim: filetype=sh diff --git a/test/system/055-rm.bats b/test/system/055-rm.bats index 0ef2216b8..dcd679a1f 100644 --- a/test/system/055-rm.bats +++ b/test/system/055-rm.bats @@ -96,4 +96,11 @@ load helpers run_podman 137 run --name $rand $IMAGE sleep 30 } +@test "podman container rm --force bogus" { + run_podman 1 container rm bogus + is "$output" "Error: no container with name or ID \"bogus\" found: no such container" "Should print error" + run_podman container rm --force bogus + is "$output" "" "Should print no output" +} + # vim: filetype=sh diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats index da60112a0..dfc1a8413 100644 --- a/test/system/160-volumes.bats +++ b/test/system/160-volumes.bats @@ -473,4 +473,11 @@ EOF run_podman image rm --force localhost/volume_image } +@test "podman volume rm --force bogus" { + run_podman 1 volume rm bogus + is "$output" "Error: no volume with name \"bogus\" found: no such volume" "Should print error" + run_podman volume rm --force bogus + is "$output" "" "Should print no output" +} + # vim: filetype=sh diff --git a/test/system/200-pod.bats b/test/system/200-pod.bats index 7b7f5e8bb..8d884f6af 100644 --- a/test/system/200-pod.bats +++ b/test/system/200-pod.bats @@ -517,4 +517,11 @@ spec: wait } +@test "podman pod rm --force bogus" { + run_podman 1 pod rm bogus + is "$output" "Error: .*bogus.*: no such pod" "Should print error" + run_podman pod rm --force bogus + is "$output" "" "Should print no output" +} + # vim: filetype=sh diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 50eb15216..d0f9266ba 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -259,7 +259,7 @@ load helpers run_podman rm -t 0 -f $cid run_podman network rm $mynetname - run_podman 1 network rm -f $mynetname + run_podman 1 network rm $mynetname } @test "podman network reload" { @@ -758,4 +758,11 @@ EOF done } +@test "podman network rm --force bogus" { + run_podman 1 network rm bogus + is "$output" "Error: unable to find network with name or ID bogus: network not found" "Should print error" + run_podman network rm --force bogus + is "$output" "" "Should print no output" +} + # vim: filetype=sh |