diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-30 09:18:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 09:18:41 +0000 |
commit | e9edddaaf2ab9d769d36adf00f97034db0a3cadf (patch) | |
tree | 8d614f0a6a303c9f78605ca91fd04cf90b605d16 /test/e2e/common_test.go | |
parent | b68b6f334d4a83de35d68cc359365b348e72ad6b (diff) | |
parent | b496802413aecf95b0d2786cb6e13618b388a406 (diff) | |
download | podman-e9edddaaf2ab9d769d36adf00f97034db0a3cadf.tar.gz podman-e9edddaaf2ab9d769d36adf00f97034db0a3cadf.tar.bz2 podman-e9edddaaf2ab9d769d36adf00f97034db0a3cadf.zip |
Merge pull request #7799 from rhatdan/rootless
Make all Skips specify a reason
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r-- | test/e2e/common_test.go | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 1943020c3..f4c80d865 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -599,6 +599,24 @@ func (p *PodmanTestIntegration) CreateSeccompJson(in []byte) (string, error) { return jsonFile, nil } +func SkipIfRootlessCgroupsV1(reason string) { + if len(reason) < 5 { + panic("SkipIfRootlessCgroupsV1 must specify a reason to skip") + } + if os.Geteuid() != 0 && !CGROUPSV2 { + Skip("[rootless]: " + reason) + } +} + +func SkipIfRootless(reason string) { + if len(reason) < 5 { + panic("SkipIfRootless must specify a reason to skip") + } + if os.Geteuid() != 0 { + ginkgo.Skip("[rootless]: " + reason) + } +} + func SkipIfNotFedora() { info := GetHostDistributionInfo() if info.Distribution != "fedora" { @@ -610,21 +628,21 @@ 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 SkipIfCgroupV1(reason string) { + if len(reason) < 5 { + panic("SkipIfCgroupV1 must specify a reason to skip") + } + if !CGROUPSV2 { + Skip(reason) } } -func SkipIfCgroupV2() { - cgroupsv2, err := cgroups.IsCgroup2UnifiedMode() - Expect(err).To(BeNil()) - - if cgroupsv2 { - Skip("Skip on systems with cgroup V2 systems") +func SkipIfCgroupV2(reason string) { + if len(reason) < 5 { + panic("SkipIfCgroupV2 must specify a reason to skip") + } + if CGROUPSV2 { + Skip(reason) } } |