summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-04 10:58:10 -0500
committerGitHub <noreply@github.com>2020-03-04 10:58:10 -0500
commit90eef95cb1591f20f5716225cf9b2c8c415fc3fc (patch)
tree9f19d9affffb9c57b5888e2fb3d12b9c642d4a73 /test
parenta8bc423e2989ceff1ee2ca79d6c1bd8314901e11 (diff)
parent11e5c53d1191f7a324f212aa2ca2ec2aad1b4676 (diff)
downloadpodman-90eef95cb1591f20f5716225cf9b2c8c415fc3fc.tar.gz
podman-90eef95cb1591f20f5716225cf9b2c8c415fc3fc.tar.bz2
podman-90eef95cb1591f20f5716225cf9b2c8c415fc3fc.zip
Merge pull request #4772 from boaz0/closes_4628
Add the rmi flag to podman-run to delete container image
Diffstat (limited to 'test')
-rw-r--r--test/system/030-run.bats17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index f1e9776c1..b89c76981 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -136,4 +136,21 @@ echo $rand | 0 | $rand
run_podman rmi busybox
}
+# 'run --rmi' deletes the image in the end unless it's used by another container.
+@test "podman run --rmi - remove image" {
+ skip_if_remote "podman-remote does not emit 'Trying to pull' msgs"
+ run_podman 0 run --rmi --rm redis /bin/true
+ run_podman 1 image exists redis
+}
+
+
+@test "podman run --rmi - not remove image" {
+ skip_if_remote "podman-remote does not emit 'Trying to pull' msgs"
+ run_podman run redis /bin/true
+ run_podman images | grep redis
+ run_podman run --rmi --rm redis /bin/true
+ run_podman images | grep redis
+ run_podman 0 rm -a
+}
+
# vim: filetype=sh