summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-17 15:19:45 -0400
committerGitHub <noreply@github.com>2020-04-17 15:19:45 -0400
commitbd8a0b08cdea5f15d6033b24038ba71aef1f8962 (patch)
tree581e283021a0edff9dfd89be73ddd7ccceb42b1d /test/e2e
parentba289dcd79e3a2b5ec5dc02bd8adb84c93bef577 (diff)
parentd8321363498c349647409dea1b6e15f8cf0ac17a (diff)
downloadpodman-bd8a0b08cdea5f15d6033b24038ba71aef1f8962.tar.gz
podman-bd8a0b08cdea5f15d6033b24038ba71aef1f8962.tar.bz2
podman-bd8a0b08cdea5f15d6033b24038ba71aef1f8962.zip
Merge pull request #5548 from kunalkushwaha/image-prune
image prune skips images with child images.
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/prune_test.go29
1 files changed, 27 insertions, 2 deletions
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index 672b0e103..83a8d3b18 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -87,7 +87,7 @@ var _ = Describe("Podman prune", func() {
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
})
- It("podman image prune none images", func() {
+ It("podman image prune skip cache images", func() {
SkipIfRemote()
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
@@ -105,10 +105,35 @@ var _ = Describe("Podman prune", func() {
after.WaitWithDefaultTimeout()
Expect(none.ExitCode()).To(Equal(0))
hasNoneAfter, _ := after.GrepString("<none>")
- Expect(hasNoneAfter).To(BeFalse())
+ Expect(hasNoneAfter).To(BeTrue())
Expect(len(after.OutputToStringArray()) > 1).To(BeTrue())
})
+ It("podman image prune dangling images", func() {
+ SkipIfRemote()
+ podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
+ podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
+
+ none := podmanTest.Podman([]string{"images", "-a"})
+ none.WaitWithDefaultTimeout()
+ Expect(none.ExitCode()).To(Equal(0))
+ hasNone, result := none.GrepString("<none>")
+ Expect(len(result)).To(Equal(2))
+ Expect(hasNone).To(BeTrue())
+
+ prune := podmanTest.Podman([]string{"image", "prune", "-f"})
+ prune.WaitWithDefaultTimeout()
+ Expect(prune.ExitCode()).To(Equal(0))
+
+ after := podmanTest.Podman([]string{"images", "-a"})
+ after.WaitWithDefaultTimeout()
+ Expect(none.ExitCode()).To(Equal(0))
+ hasNoneAfter, result := none.GrepString("<none>")
+ Expect(hasNoneAfter).To(BeTrue())
+ Expect(len(after.OutputToStringArray()) > 1).To(BeTrue())
+ Expect(len(result) > 0).To(BeTrue())
+ })
+
It("podman image prune unused images", func() {
podmanTest.RestoreAllArtifacts()
prune := podmanTest.PodmanNoCache([]string{"image", "prune", "-af"})