summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-02-01 13:23:49 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2022-02-01 16:23:58 +0100
commit865f0a1977fbddbf37550d0e3c56cfacb62b0aec (patch)
treec6b88e91774525941953b1f07fadf0ab849dd5d5 /test
parent905d31ddd358bb6c40082c391102bbf92a04fad6 (diff)
downloadpodman-865f0a1977fbddbf37550d0e3c56cfacb62b0aec.tar.gz
podman-865f0a1977fbddbf37550d0e3c56cfacb62b0aec.tar.bz2
podman-865f0a1977fbddbf37550d0e3c56cfacb62b0aec.zip
libpod: report slirp4netns network stats
by default slirp4netns uses the tap0 device. When slirp4netns is used, use that device by default instead of eth0. Closes: https://github.com/containers/podman/issues/11695 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/stats_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index 8788369eb..7435a0e3b 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -185,6 +185,19 @@ var _ = Describe("Podman stats", func() {
Expect(session).Should(Exit(0))
})
+ It("podman reads slirp4netns network stats", func() {
+ session := podmanTest.Podman([]string{"run", "-d", "--network", "slirp4netns", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ cid := session.OutputToString()
+
+ stats := podmanTest.Podman([]string{"stats", "--format", "'{{.NetIO}}'", "--no-stream", cid})
+ stats.WaitWithDefaultTimeout()
+ Expect(stats).Should(Exit(0))
+ Expect(stats.OutputToString()).To(Not(ContainSubstring("-- / --")))
+ })
+
// Regression test for #8265
It("podman stats with custom memory limits", func() {
// Run three containers. One with a memory limit. Make sure