From 37f3b191d5318b7d25893eabf4e57b568c326773 Mon Sep 17 00:00:00 2001 From: Sujil02 Date: Thu, 2 Apr 2020 22:56:59 -0400 Subject: Add pod prune for api v2. Add the ability to prune pods for api v2, Includes the addition of force flag, for client side prompt. Update test suite to support this use case. Signed-off-by: Sujil02 --- test/e2e/pod_prune_test.go | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/pod_prune_test.go b/test/e2e/pod_prune_test.go index 389d3cb27..d98383331 100644 --- a/test/e2e/pod_prune_test.go +++ b/test/e2e/pod_prune_test.go @@ -36,7 +36,7 @@ var _ = Describe("Podman pod prune", func() { _, ec, _ := podmanTest.CreatePod("") Expect(ec).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "prune"}) + result := podmanTest.Podman([]string{"pod", "prune", "--force"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) }) @@ -49,7 +49,7 @@ var _ = Describe("Podman pod prune", func() { ec2.WaitWithDefaultTimeout() Expect(ec2.ExitCode()).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "prune"}) + result := podmanTest.Podman([]string{"pod", "prune", "-f"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To((Equal(0))) @@ -65,7 +65,7 @@ var _ = Describe("Podman pod prune", func() { _, ec2, _ := podmanTest.RunLsContainerInPod("", podid) Expect(ec2).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "prune"}) + result := podmanTest.Podman([]string{"pod", "prune", "-f"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) @@ -73,21 +73,4 @@ var _ = Describe("Podman pod prune", func() { result.WaitWithDefaultTimeout() Expect(len(result.OutputToStringArray())).To(Equal(0)) }) - - It("podman pod prune -f does remove a running container", func() { - _, ec, podid := podmanTest.CreatePod("") - Expect(ec).To(Equal(0)) - - session := podmanTest.RunTopContainerInPod("", podid) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - - result := podmanTest.Podman([]string{"pod", "prune", "-f"}) - result.WaitWithDefaultTimeout() - Expect(result.ExitCode()).To(Equal(0)) - - result = podmanTest.Podman([]string{"ps", "-q"}) - result.WaitWithDefaultTimeout() - Expect(result.OutputToString()).To(BeEmpty()) - }) }) -- cgit v1.2.3-54-g00ecf