From 021027a24b7b6906a2d7ed86c67e34167bc26284 Mon Sep 17 00:00:00 2001 From: haircommander Date: Mon, 20 Aug 2018 18:29:44 -0400 Subject: Enable pod stats with short ID and name Signed-off-by: haircommander Closes: #1307 Approved by: rhatdan --- test/e2e/pod_stats_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test') diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go index 692946f33..b7f939aa9 100644 --- a/test/e2e/pod_stats_test.go +++ b/test/e2e/pod_stats_test.go @@ -61,6 +61,44 @@ var _ = Describe("Podman pod stats", func() { Expect(stats.ExitCode()).To(Equal(0)) }) + 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() + + session = podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + stats := podmanTest.Podman([]string{"pod", "stats", "--no-stream", podid[:5]}) + stats.WaitWithDefaultTimeout() + Expect(stats.ExitCode()).To(Equal(0)) + }) + + 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() + + session = podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + stats := podmanTest.Podman([]string{"pod", "stats", "--no-stream", "test"}) + stats.WaitWithDefaultTimeout() + Expect(stats.ExitCode()).To(Equal(0)) + }) + It("podman stats on running pods", func() { session := podmanTest.Podman([]string{"pod", "create"}) session.WaitWithDefaultTimeout() -- cgit v1.2.3-54-g00ecf