diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_stats_test.go | 16 | ||||
-rw-r--r-- | test/e2e/pod_top_test.go | 46 |
2 files changed, 23 insertions, 39 deletions
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go index c230c8973..f9c8e06c4 100644 --- a/test/e2e/pod_stats_test.go +++ b/test/e2e/pod_stats_test.go @@ -60,12 +60,10 @@ var _ = Describe("Podman pod stats", func() { }) It("podman stats on a specific running pod with shortID", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.RunTopContainerInPod("", podid) + session := podmanTest.RunTopContainerInPod("", podid) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -79,12 +77,10 @@ var _ = Describe("Podman pod stats", func() { }) It("podman stats on a specific running pod with name", func() { - session := podmanTest.Podman([]string{"pod", "create", "--name", "test"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("test") + Expect(ec).To(Equal(0)) - session = podmanTest.RunTopContainerInPod("", podid) + session := podmanTest.RunTopContainerInPod("", podid) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go index 2b4aa540f..0ecc8e6e8 100644 --- a/test/e2e/pod_top_test.go +++ b/test/e2e/pod_top_test.go @@ -44,10 +44,8 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on non-running pod", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) result := podmanTest.Podman([]string{"top", podid}) result.WaitWithDefaultTimeout() @@ -55,12 +53,10 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on pod", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -71,12 +67,10 @@ var _ = Describe("Podman top", func() { }) It("podman pod top with options", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -87,12 +81,10 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on pod invalid options", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -102,12 +94,10 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on pod with containers in same pid namespace", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) cid := session.OutputToString() @@ -123,12 +113,10 @@ var _ = Describe("Podman top", func() { }) It("podman pod top on pod with containers in different namespace", func() { - session := podmanTest.Podman([]string{"pod", "create"}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - podid := session.OutputToString() + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) - session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) |