aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-02-01 13:23:49 +0100
committerMatthew Heon <matthew.heon@pm.me>2022-02-03 14:46:01 -0500
commit9d3bcb58755e820fb3d7829260a5dd1292628f38 (patch)
tree94fd7b213bae9dfdf971f59a1c910a6fec166b81 /test
parentf65b62c98742e2db706f64b4c41fec512290e533 (diff)
downloadpodman-9d3bcb58755e820fb3d7829260a5dd1292628f38.tar.gz
podman-9d3bcb58755e820fb3d7829260a5dd1292628f38.tar.bz2
podman-9d3bcb58755e820fb3d7829260a5dd1292628f38.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