summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-20 18:24:35 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-21 15:37:39 +0000
commit149481a57184becf3e9be329d253602654414118 (patch)
treedff153e67e834673756e2f10aed2c6bfb7494067 /test/e2e
parent021027a24b7b6906a2d7ed86c67e34167bc26284 (diff)
downloadpodman-149481a57184becf3e9be329d253602654414118.tar.gz
podman-149481a57184becf3e9be329d253602654414118.tar.bz2
podman-149481a57184becf3e9be329d253602654414118.zip
Fixed segfault in stats where container had netNS none or from container
Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1306 Approved by: rhatdan
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/stats_test.go23
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))
+ })
})