summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-09-14 10:22:49 +0200
committerMatthew Heon <mheon@redhat.com>2021-09-16 09:42:14 -0400
commit939db105c31f332c202d92182fe1aa9a790cdeb5 (patch)
treea09801fcd7ea379c9b268f35e186f0e9b4170f3f /test
parente0881fd5eb655952528536bb89b70fc781b930ce (diff)
downloadpodman-939db105c31f332c202d92182fe1aa9a790cdeb5.tar.gz
podman-939db105c31f332c202d92182fe1aa9a790cdeb5.tar.bz2
podman-939db105c31f332c202d92182fe1aa9a790cdeb5.zip
tests: enable --cgroups=disabled test for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index cf1ce699e..cb61aba21 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -11,6 +11,7 @@ import (
"syscall"
"time"
+ "github.com/containers/podman/v3/pkg/cgroups"
. "github.com/containers/podman/v3/test/utils"
"github.com/containers/storage/pkg/stringid"
"github.com/mrunalp/fileutils"
@@ -1323,13 +1324,19 @@ USER mail`, BB)
})
It("podman run with cgroups=disabled runs without cgroups", func() {
- SkipIfRootless("FIXME: I believe this should work but need to fix this test")
SkipIfRootlessCgroupsV1("Disable cgroups not supported on cgroupv1 for rootless users")
// Only works on crun
if !strings.Contains(podmanTest.OCIRuntime, "crun") {
Skip("Test only works on crun")
}
+ ownsCgroup, err := cgroups.UserOwnsCurrentSystemdCgroup()
+ Expect(err).ShouldNot(HaveOccurred())
+ if !ownsCgroup {
+ // Podman moves itself to a new cgroup if it doesn't own the current cgroup
+ Skip("Test only works when Podman owns the current cgroup")
+ }
+
trim := func(i string) string {
return strings.TrimSuffix(i, "\n")
}