diff options
Diffstat (limited to 'test/e2e/stats_test.go')
-rw-r--r-- | test/e2e/stats_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go index ad40cbe5a..8096f58b2 100644 --- a/test/e2e/stats_test.go +++ b/test/e2e/stats_test.go @@ -90,4 +90,27 @@ var _ = Describe("Podman stats", func() { Expect(session.IsJSONOutputValid()).To(BeTrue()) }) + It("podman stats on a container with no net ns", func() { + session := podmanTest.Podman([]string{"run", "-d", "--net", "none", ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + session = podmanTest.Podman([]string{"stats", "--no-stream", "-a"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) + + It("podman stats on a container that joined another's net ns", func() { + session := podmanTest.RunTopContainer("") + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + cid := session.OutputToString() + + session = podmanTest.Podman([]string{"run", "-d", "--net", fmt.Sprintf("container:%s", cid), ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"stats", "--no-stream", "-a"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) }) |