summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-07-27 14:10:19 -0400
committerGitHub <noreply@github.com>2022-07-27 14:10:19 -0400
commit432348e8e4e95d32bb26ceca4d467ff9f726dd89 (patch)
treeb1551e08b62c37dc7ca7a0ce3f32e839802ed197 /test
parenteea8e570f2af82944e61410e5e7dd9b540feae34 (diff)
parent75419c5d887e23f93a465311b02bb76d8cea1940 (diff)
downloadpodman-432348e8e4e95d32bb26ceca4d467ff9f726dd89.tar.gz
podman-432348e8e4e95d32bb26ceca4d467ff9f726dd89.tar.bz2
podman-432348e8e4e95d32bb26ceca4d467ff9f726dd89.zip
Merge pull request #14959 from rhatdan/rm
When removing objects specifying --force,podman should exit with 0
Diffstat (limited to 'test')
-rw-r--r--test/system/010-images.bats7
-rw-r--r--test/system/055-rm.bats7
-rw-r--r--test/system/160-volumes.bats7
-rw-r--r--test/system/200-pod.bats7
-rw-r--r--test/system/500-networking.bats9
5 files changed, 36 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/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 18e806699..6829c6a78 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 667e2baef..da2f7cd59 100644
--- a/test/system/200-pod.bats
+++ b/test/system/200-pod.bats
@@ -547,4 +547,11 @@ io.max | $lomajmin rbps=1048576 wbps=1048576 riops=max wiops=max
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 f45540f5f..b9a173c2a 100644
--- a/test/system/500-networking.bats
+++ b/test/system/500-networking.bats
@@ -260,7 +260,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" {
@@ -760,4 +760,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