diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-12-08 09:59:00 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-12-08 09:59:00 -0500 |
commit | 46337b4708362e9fe2915c7efddc353d88a2cb5e (patch) | |
tree | 5412a06203ddc5380663df921143fccb9728765f /test/e2e/stats_test.go | |
parent | 0cccba834ff2939579f7ef4c340a9337dc9d7d2c (diff) | |
download | podman-46337b4708362e9fe2915c7efddc353d88a2cb5e.tar.gz podman-46337b4708362e9fe2915c7efddc353d88a2cb5e.tar.bz2 podman-46337b4708362e9fe2915c7efddc353d88a2cb5e.zip |
Make `podman stats` slirp check more robust
Just checking for `rootless.IsRootless()` does not catch all the
cases where slirp4netns is in use - we actually allow it to be
used as root as well. Fortify the conditional here so we don't
fail in the root + slirp case.
Fixes #7883
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e/stats_test.go')
-rw-r--r-- | test/e2e/stats_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go index 5e8a7a3d0..ab117a2a0 100644 --- a/test/e2e/stats_test.go +++ b/test/e2e/stats_test.go @@ -128,6 +128,16 @@ var _ = Describe("Podman stats", func() { Expect(session.ExitCode()).To(Equal(0)) }) + It("podman stats on container with forced slirp4netns", func() { + // This will force the slirp4netns net mode to be tested as root + session := podmanTest.Podman([]string{"run", "-d", "--net", "slirp4netns", 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)) + }) + // Regression test for #8265 It("podman stats with custom memory limits", func() { // Run thre containers. One with a memory limit. Make sure |