Skip to content

Commit d1d1bb8

Browse files
committed
test/e2e: delete CgV1 skips, delete tests skipped on Cgv2
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
1 parent 9fafdb6 commit d1d1bb8

28 files changed

+52
-354
lines changed

test/e2e/cleanup_test.go

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

9999
It("podman cleanup paused container", func() {
100-
SkipIfRootlessCgroupsV1("Pause is not supported in cgroups v1")
101100
session := podmanTest.RunTopContainer("paused")
102101
session.WaitWithDefaultTimeout()
103102
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())
@@ -143,7 +141,6 @@ var _ = Describe("Podman container clone", func() {
143141
})
144142

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

test/e2e/containers_conf_test.go

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

3232
It("limits test", func() {
33-
SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
3433
// containers.conf is set to "nofile=500:500"
3534
session := podmanTest.Podman([]string{"run", "--rm", fedoraMinimal, "ulimit", "-n"})
3635
session.WaitWithDefaultTimeout()
@@ -56,7 +55,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
5655
})
5756

5857
It("oom-score-adj", func() {
59-
SkipIfRootlessCgroupsV1("Setting limits not supported on cgroupv1 for rootless users")
6058
// containers.conf is set to "oom_score_adj=999"
6159
session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "cat", "/proc/self/oom_score_adj"})
6260
session.WaitWithDefaultTimeout()
@@ -86,9 +84,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
8684
})
8785

8886
It("cgroup_conf in containers.conf", func() {
89-
if isCgroupsV1() {
90-
Skip("Setting cgroup_confs not supported on cgroupv1")
91-
}
9287
// FIXME: Needs crun-1.8.2-2 to allow this with --cgroup-manager=cgroupfs, once this is available remove the skip below.
9388
SkipIfRootless("--cgroup-manager=cgoupfs and --cgroup-conf not supported in rootless mode with crun")
9489
conffile := filepath.Join(podmanTest.TempDir, "container.conf")
@@ -147,7 +142,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
147142
})
148143

149144
It("add capabilities", func() {
150-
SkipIfRootlessCgroupsV1("Not supported for rootless + CGroupsV1")
151145
cap := podmanTest.Podman([]string{"run", ALPINE, "grep", "CapEff", "/proc/self/status"})
152146
cap.WaitWithDefaultTimeout()
153147
Expect(cap).Should(ExitCleanly())
@@ -193,7 +187,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
193187
})
194188

195189
verifyNSHandling := func(nspath, option string) {
196-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
197190
os.Setenv("CONTAINERS_CONF", "config/containers-ns.conf")
198191
if IsRemote() {
199192
podmanTest.RestartRemoteService()

test/e2e/cp_test.go

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

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

test/e2e/create_test.go

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

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

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

test/e2e/generate_kube_test.go

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

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

637636
It("on pod with cpu limit", func() {
638-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
639637
podName := "testCpuLimit"
640638
podSession := podmanTest.Podman([]string{"pod", "create", "--name", podName})
641639
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() {
@@ -23,7 +22,6 @@ var _ = Describe("Podman generate spec", func() {
2322
})
2423

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

3634
It("podman generate spec file", func() {
37-
SkipIfRootlessCgroupsV1("Not supported for rootless + CgroupsV1")
3835
session := podmanTest.Podman([]string{"create", "--cpus", "5", "--name", "specgen", ALPINE})
3936
session.WaitWithDefaultTimeout()
4037
Expect(session).Should(ExitCleanly())
@@ -58,12 +55,6 @@ var _ = Describe("Podman generate spec", func() {
5855

5956
session = podmanTest.Podman([]string{"generate", "spec", "--compact", "podspecgen"})
6057
session.WaitWithDefaultTimeout()
61-
62-
if isRootless() && !CGROUPSV2 {
63-
Expect(session).Should(Exit(0))
64-
Expect(session.ErrorToString()).Should(ContainSubstring("Resource limits are not supported and ignored on cgroups V1 rootless"))
65-
} else {
66-
Expect(session).Should(ExitCleanly())
67-
}
58+
Expect(session).Should(ExitCleanly())
6859
})
6960
})

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
@@ -107,7 +107,6 @@ var _ = Describe("Podman kill", func() {
107107
})
108108

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

0 commit comments

Comments
 (0)