summaryrefslogtreecommitdiff
path: root/test/e2e/pod_stats_test.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-12-04 11:14:42 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-12-04 13:11:58 +0100
commit077ee1a10dafcebe8149f674eee10748a2114336 (patch)
treebcf9996ecec850b2cccdb4a2ebf0cf2c518d744b /test/e2e/pod_stats_test.go
parent3f1675d9026343c73a456a483ce633ffd5d00712 (diff)
downloadpodman-077ee1a10dafcebe8149f674eee10748a2114336.tar.gz
podman-077ee1a10dafcebe8149f674eee10748a2114336.tar.bz2
podman-077ee1a10dafcebe8149f674eee10748a2114336.zip
rootless: enable stats test on cgroup v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/pod_stats_test.go')
-rw-r--r--test/e2e/pod_stats_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go
index 4d573a2c7..347f33e62 100644
--- a/test/e2e/pod_stats_test.go
+++ b/test/e2e/pod_stats_test.go
@@ -5,6 +5,7 @@ package integration
import (
"os"
+ "github.com/containers/libpod/pkg/cgroups"
. "github.com/containers/libpod/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -13,12 +14,17 @@ import (
var _ = Describe("Podman pod stats", func() {
var (
tempdir string
- err error
podmanTest *PodmanTestIntegration
)
BeforeEach(func() {
- SkipIfRootless()
+ cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
+ Expect(err).To(BeNil())
+
+ if os.Geteuid() != 0 && !cgroupsv2 {
+ Skip("This function is not enabled for rootless podman not running on cgroups v2")
+ }
+
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)