Skip to content

Commit 050882a

Browse files
committed
test/e2e: delete CgV1 skips, delete tests skipped on Cgv2
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent bfaaf87 commit 050882a

28 files changed

+47
-346
lines changed

test/e2e/cleanup_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ var _ = Describe("Podman container cleanup", func() {
9898
})
9999

100100
It("podman cleanup paused container", func() {
101-
SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
102101
session := podmanTest.RunTopContainer("paused")
103102
session.WaitWithDefaultTimeout()
104103
Expect(session).Should(ExitCleanly())

test/e2e/common_test.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
. "github.com/onsi/gomega"
3939
. "github.com/onsi/gomega/gexec"
4040
"github.com/sirupsen/logrus"
41-
"go.podman.io/common/pkg/cgroups"
4241
"go.podman.io/common/pkg/libartifact"
4342
"go.podman.io/storage/pkg/ioutils"
4443
"go.podman.io/storage/pkg/lockfile"
@@ -53,7 +52,6 @@ var (
5352
CGROUP_MANAGER = "systemd"
5453
RESTORE_IMAGES = []string{ALPINE, BB, NGINX_IMAGE}
5554
defaultWaitTimeout = 90
56-
CGROUPSV2, _ = cgroups.IsCgroup2UnifiedMode()
5755
)
5856

5957
// PodmanTestIntegration struct for command line options
@@ -1080,13 +1078,6 @@ func SkipIfRunc(p *PodmanTestIntegration, reason string) {
10801078
}
10811079
}
10821080

1083-
func SkipIfRootlessCgroupsV1(reason string) {
1084-
checkReason(reason)
1085-
if isRootless() && !CGROUPSV2 {
1086-
Skip("[rootless]: " + reason)
1087-
}
1088-
}
1089-
10901081
func SkipIfRootless(reason string) {
10911082
checkReason(reason)
10921083
if isRootless() {
@@ -1179,24 +1170,6 @@ func isRootless() bool {
11791170
return os.Geteuid() != 0
11801171
}
11811172

1182-
func isCgroupsV1() bool {
1183-
return !CGROUPSV2
1184-
}
1185-
1186-
func SkipIfCgroupV1(reason string) {
1187-
checkReason(reason)
1188-
if isCgroupsV1() {
1189-
Skip(reason)
1190-
}
1191-
}
1192-
1193-
func SkipIfCgroupV2(reason string) {
1194-
checkReason(reason)
1195-
if CGROUPSV2 {
1196-
Skip(reason)
1197-
}
1198-
}
1199-
12001173
func isContainerized() bool {
12011174
// This is set to "podman" by podman automatically
12021175
return os.Getenv("container") != ""

test/e2e/container_clone_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var _ = Describe("Podman container clone", func() {
1515
})
1616

1717
It("podman container clone basic test", func() {
18-
SkipIfRootlessCgroupsV1("starting a container with the memory limits not supported")
1918
create := podmanTest.Podman([]string{"create", ALPINE})
2019
create.WaitWithDefaultTimeout()
2120
Expect(create).To(ExitCleanly())
@@ -68,7 +67,6 @@ var _ = Describe("Podman container clone", func() {
6867
})
6968

7069
It("podman container clone resource limits override", func() {
71-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
7270
create := podmanTest.Podman([]string{"create", "--cpus=5", ALPINE})
7371
create.WaitWithDefaultTimeout()
7472
Expect(create).To(ExitCleanly())
@@ -144,7 +142,6 @@ var _ = Describe("Podman container clone", func() {
144142
})
145143

146144
It("podman container clone in a pod", func() {
147-
SkipIfRootlessCgroupsV1("starting a container with the memory limits not supported")
148145
run := podmanTest.Podman([]string{"run", "-dt", "--pod", "new:1234", ALPINE, "sleep", "20"})
149146
run.WaitWithDefaultTimeout()
150147
Expect(run).To(ExitCleanly())

test/e2e/containers_conf_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
3232
})
3333

3434
It("limits test", func() {
35-
SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
3635
// containers.conf is set to "nofile=500:500"
3736
session := podmanTest.Podman([]string{"run", "--rm", fedoraMinimal, "ulimit", "-n"})
3837
session.WaitWithDefaultTimeout()
@@ -59,7 +58,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
5958
})
6059

6160
It("oom-score-adj", func() {
62-
SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
6361
// containers.conf is set to "oom_score_adj=999"
6462
session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "cat", "/proc/self/oom_score_adj"})
6563
session.WaitWithDefaultTimeout()
@@ -91,9 +89,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
9189
})
9290

9391
It("cgroup_conf in containers.conf", func() {
94-
if isCgroupsV1() {
95-
Skip("Setting cgroup_confs not supported on cgroupv1")
96-
}
9792
// FIXME: Needs crun-1.8.2-2 to allow this with --cgroup-manager=cgroupfs, once this is available remove the skip below.
9893
SkipIfRootless("--cgroup-manager=cgoupfs and --cgroup-conf not supported in rootless mode with crun")
9994
conffile := filepath.Join(podmanTest.TempDir, "container.conf")
@@ -152,7 +147,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
152147
})
153148

154149
It("add capabilities", func() {
155-
SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
156150
cap := podmanTest.Podman([]string{"run", ALPINE, "grep", "CapEff", "/proc/self/status"})
157151
cap.WaitWithDefaultTimeout()
158152
Expect(cap).Should(ExitCleanly())
@@ -198,7 +192,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
198192
})
199193

200194
verifyNSHandling := func(nspath, option string) {
201-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
202195
os.Setenv("CONTAINERS_CONF", "config/containers-ns.conf")
203196
if IsRemote() {
204197
podmanTest.RestartRemoteService()

test/e2e/cp_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ var _ = Describe("Podman cp", func() {
7373

7474
// Copy a file to the container, then back to the host in --pid=host
7575
It("podman cp --pid=host file", func() {
76-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
7776
srcFile, err := os.CreateTemp("", "")
7877
Expect(err).ToNot(HaveOccurred())
7978
defer srcFile.Close()

test/e2e/create_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ var _ = Describe("Podman create", func() {
427427
})
428428

429429
It("podman create with -m 1000000 sets swap to 2000000", func() {
430-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
431430
numMem := 1000000
432431
ctrName := "testCtr"
433432
session := podmanTest.Podman([]string{"create", "-t", "-m", fmt.Sprintf("%db", numMem), "--name", ctrName, ALPINE, "/bin/sh"})
@@ -442,7 +441,6 @@ var _ = Describe("Podman create", func() {
442441
})
443442

444443
It("podman create --cpus 5 sets nanocpus", func() {
445-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
446444
numCpus := 5
447445
nanoCPUs := numCpus * 1000000000
448446
ctrName := "testCtr"

test/e2e/generate_kube_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ var _ = Describe("Podman kube generate", func() {
608608
})
609609

610610
It("on pod with memory limit", func() {
611-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
612611
podName := "testMemoryLimit"
613612
podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName})
614613
podSession.WaitWithDefaultTimeout()
@@ -634,7 +633,6 @@ var _ = Describe("Podman kube generate", func() {
634633
})
635634

636635
It("on pod with cpu limit", func() {
637-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
638636
podName := "testCpuLimit"
639637
podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName})
640638
podSession.WaitWithDefaultTimeout()

test/e2e/generate_spec_test.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
. "github.com/containers/podman/v6/test/utils"
99
. "github.com/onsi/ginkgo/v2"
1010
. "github.com/onsi/gomega"
11-
. "github.com/onsi/gomega/gexec"
1211
)
1312

1413
var _ = Describe("Podman generate spec", func() {
@@ -24,7 +23,6 @@ var _ = Describe("Podman generate spec", func() {
2423
})
2524

2625
It("podman generate spec basic usage", func() {
27-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
2826
session := podmanTest.Podman([]string{"create", "--cpus", "5", "--name", "specgen", ALPINE})
2927
session.WaitWithDefaultTimeout()
3028
Expect(session).Should(ExitCleanly())
@@ -35,7 +33,6 @@ var _ = Describe("Podman generate spec", func() {
3533
})
3634

3735
It("podman generate spec file", func() {
38-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
3936
session := podmanTest.Podman([]string{"create", "--cpus", "5", "--name", "specgen", ALPINE})
4037
session.WaitWithDefaultTimeout()
4138
Expect(session).Should(ExitCleanly())
@@ -60,12 +57,6 @@ var _ = Describe("Podman generate spec", func() {
6057

6158
session = podmanTest.Podman([]string{"generate", "spec", "--compact", "podspecgen"})
6259
session.WaitWithDefaultTimeout()
63-
64-
if isRootless() && !CGROUPSV2 {
65-
Expect(session).Should(Exit(0))
66-
Expect(session.ErrorToString()).Should(ContainSubstring("Resource limits are not supported and ignored on cgroups V1 rootless"))
67-
} else {
68-
Expect(session).Should(ExitCleanly())
69-
}
60+
Expect(session).Should(ExitCleanly())
7061
})
7162
})

test/e2e/info_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ var _ = Describe("Podman Info", func() {
133133

134134
It("Podman info must contain cgroupControllers with RelevantControllers", func() {
135135
SkipIfRootless("Hard to tell which controllers are going to be enabled for rootless")
136-
SkipIfRootlessCgroupsV1("Disable cgroups not supported on cgroupv1 for rootless users")
137136
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.CgroupControllers}}"})
138137
session.WaitWithDefaultTimeout()
139138
Expect(session).To(ExitCleanly())

test/e2e/kill_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ var _ = Describe("Podman kill", func() {
108108
})
109109

110110
It("podman kill paused container", func() {
111-
SkipIfRootlessCgroupsV1("pause is not supported for cgroupv1 rootless")
112111
ctrName := "testctr"
113112
session := podmanTest.RunTopContainer(ctrName)
114113
session.WaitWithDefaultTimeout()

0 commit comments

Comments
 (0)