aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r--test/e2e/common_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index aa0e9635a..f475a927c 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -14,6 +14,7 @@ import (
"time"
"github.com/containers/libpod/v2/libpod/define"
+ "github.com/containers/libpod/v2/pkg/cgroups"
"github.com/containers/libpod/v2/pkg/inspect"
"github.com/containers/libpod/v2/pkg/rootless"
. "github.com/containers/libpod/v2/test/utils"
@@ -599,3 +600,21 @@ func SkipIfNotFedora() {
func isRootless() bool {
return os.Geteuid() != 0
}
+
+func SkipIfCgroupV1() {
+ cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
+ Expect(err).To(BeNil())
+
+ if !cgroupsv2 {
+ Skip("Skip on systems with cgroup V1 systems")
+ }
+}
+
+func SkipIfCgroupV2() {
+ cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
+ Expect(err).To(BeNil())
+
+ if cgroupsv2 {
+ Skip("Skip on systems with cgroup V2 systems")
+ }
+}