summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-07-27 16:11:47 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-28 01:40:28 +0000
commit87d8edb4c10e53e6e9833ff8b64c3c0041f1823b (patch)
treecc0f7c1b71844e97f13e7003b6d2d4c5d6a9652a /test/e2e
parentbd7566f170d6c6f595a4e1376cabb83a62479584 (diff)
downloadpodman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.tar.gz
podman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.tar.bz2
podman-87d8edb4c10e53e6e9833ff8b64c3c0041f1823b.zip
podman rmi shouldn't delete named referenced images
If an image is created from another and it is deleted, only delete the actual image and not the parent images if the parent images have names/references. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #1174 Approved by: mheon
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/rmi_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go
index 2d096d7ba..0fdfa6797 100644
--- a/test/e2e/rmi_test.go
+++ b/test/e2e/rmi_test.go
@@ -141,6 +141,41 @@ var _ = Describe("Podman rmi", func() {
Expect(session.ExitCode()).To(Not(Equal(0)))
})
+ It("podman rmi image that is created from another named imaged", func() {
+ session := podmanTest.Podman([]string{"rmi", "-fa"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"run", "--name", "c_test1", ALPINE, "true"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"commit", "-q", "c_test1", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"run", "--name", "c_test2", "test1", "true"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"commit", "-q", "c_test2", "test2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"rm", "-a"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"rmi", "test2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"images", "-q"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(2))
+ })
+
It("podman rmi with cached images", func() {
session := podmanTest.Podman([]string{"rmi", "-fa"})
session.WaitWithDefaultTimeout()