diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-18 06:02:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 06:02:51 -0400 |
commit | e4e42b28dfef0ffd12f2087048dec61f9cb03976 (patch) | |
tree | ebce391a95795cb5861f55380047923fa7184271 /pkg/bindings/test | |
parent | 3b461ed6eb85f329ad163a4f18df3b872fe86f04 (diff) | |
parent | 37f3b191d5318b7d25893eabf4e57b568c326773 (diff) | |
download | podman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.tar.gz podman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.tar.bz2 podman-e4e42b28dfef0ffd12f2087048dec61f9cb03976.zip |
Merge pull request #5733 from sujil02/v2-pod-prune
Add pod prune for api v2
Diffstat (limited to 'pkg/bindings/test')
-rw-r--r-- | pkg/bindings/test/pods_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/bindings/test/pods_test.go b/pkg/bindings/test/pods_test.go index 579161b26..4d682a522 100644 --- a/pkg/bindings/test/pods_test.go +++ b/pkg/bindings/test/pods_test.go @@ -262,7 +262,7 @@ var _ = Describe("Podman pods", func() { var newpod2 string = "newpod2" bt.Podcreate(&newpod2) // No pods pruned since no pod in exited state - err = pods.Prune(bt.conn) + pruneResponse, err := pods.Prune(bt.conn) Expect(err).To(BeNil()) podSummary, err := pods.List(bt.conn, nil) Expect(err).To(BeNil()) @@ -279,13 +279,19 @@ var _ = Describe("Podman pods", func() { Expect(err).To(BeNil()) // FIXME sujil please fix this //Expect(response.State.Status).To(Equal(define.PodStateExited)) - err = pods.Prune(bt.conn) + pruneResponse, err = pods.Prune(bt.conn) Expect(err).To(BeNil()) + // Validate status and record pod id of pod to be pruned + //Expect(response.State.Status).To(Equal(define.PodStateExited)) + //podID := response.Config.ID + // Check if right pod was pruned + Expect(len(pruneResponse)).To(Equal(1)) + // One pod is pruned hence only one pod should be active. podSummary, err = pods.List(bt.conn, nil) Expect(err).To(BeNil()) Expect(len(podSummary)).To(Equal(1)) - // Test prune all pods in exited state. + // Test prune multiple pods. bt.Podcreate(&newpod) _, err = pods.Start(bt.conn, newpod) Expect(err).To(BeNil()) @@ -311,7 +317,7 @@ var _ = Describe("Podman pods", func() { Expect(define.StringToContainerStatus(i.State)). To(Equal(define.ContainerStateStopped)) } - err = pods.Prune(bt.conn) + _, err = pods.Prune(bt.conn) Expect(err).To(BeNil()) podSummary, err = pods.List(bt.conn, nil) Expect(err).To(BeNil()) |