summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-03-09 18:33:19 -0400
committerQi Wang <qiwan@redhat.com>2020-03-10 10:57:51 -0400
commitabb60fbba2d4e9f4795d5be8a14001e8a72ec7d7 (patch)
treef50642088f8c5fbece3e11fc0682f6ea8a5c431a /test
parentd2764e93df580755fe1b3a1befb79eeff75c4bc4 (diff)
downloadpodman-abb60fbba2d4e9f4795d5be8a14001e8a72ec7d7.tar.gz
podman-abb60fbba2d4e9f4795d5be8a14001e8a72ec7d7.tar.bz2
podman-abb60fbba2d4e9f4795d5be8a14001e8a72ec7d7.zip
container prune remove state created, configured
podman container prune should remove containers with state Created, Configured to be compatible with docker Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/prune_test.go28
-rw-r--r--test/e2e/volume_prune_test.go2
2 files changed, 29 insertions, 1 deletions
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index c9b01ad4a..672b0e103 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -59,6 +59,34 @@ var _ = Describe("Podman prune", func() {
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
})
+ It("podman container prune after create containers", func() {
+ create := podmanTest.Podman([]string{"create", "--name", "test", BB})
+ create.WaitWithDefaultTimeout()
+ Expect(create.ExitCode()).To(Equal(0))
+
+ prune := podmanTest.Podman([]string{"container", "prune", "-f"})
+ prune.WaitWithDefaultTimeout()
+ Expect(prune.ExitCode()).To(Equal(0))
+
+ Expect(podmanTest.NumberOfContainers()).To(Equal(0))
+ })
+
+ It("podman container prune after create & init containers", func() {
+ create := podmanTest.Podman([]string{"create", "--name", "test", BB})
+ create.WaitWithDefaultTimeout()
+ Expect(create.ExitCode()).To(Equal(0))
+
+ init := podmanTest.Podman([]string{"init", "test"})
+ init.WaitWithDefaultTimeout()
+ Expect(init.ExitCode()).To(Equal(0))
+
+ prune := podmanTest.Podman([]string{"container", "prune", "-f"})
+ prune.WaitWithDefaultTimeout()
+ Expect(prune.ExitCode()).To(Equal(0))
+
+ Expect(podmanTest.NumberOfContainers()).To(Equal(0))
+ })
+
It("podman image prune none images", func() {
SkipIfRemote()
podmanTest.BuildImage(pruneImage, "alpine_bash:latest", "true")
diff --git a/test/e2e/volume_prune_test.go b/test/e2e/volume_prune_test.go
index ba249278b..3049646b0 100644
--- a/test/e2e/volume_prune_test.go
+++ b/test/e2e/volume_prune_test.go
@@ -89,7 +89,7 @@ var _ = Describe("Podman volume prune", func() {
session = podmanTest.Podman([]string{"volume", "ls"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- Expect(len(session.OutputToStringArray())).To(Equal(2))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
podmanTest.Cleanup()
})