Skip to content

Commit 9f5da3a

Browse files
committed
test: remove cgroupsv1 tests and skips
Keeping SkipIfCgroupV2 and skip_if_cgroupsv2 just in case we need them in future. Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent fee6f49 commit 9f5da3a

18 files changed

+41
-175
lines changed

test/e2e/common_test.go

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ func (p *PodmanTestIntegration) RunTopContainer(name string) *PodmanSessionInteg
784784
// runs top. If the name passed != "", it will have a name, command args can also be passed in
785785
func (p *PodmanTestIntegration) RunTopContainerWithArgs(name string, args []string) *PodmanSessionIntegration {
786786
// In proxy environment, some tests need to the --http-proxy=false option (#16684)
787-
var podmanArgs = []string{"run", "--http-proxy=false"}
787+
podmanArgs := []string{"run", "--http-proxy=false"}
788788
if name != "" {
789789
podmanArgs = append(podmanArgs, "--name", name)
790790
}
@@ -803,7 +803,7 @@ func (p *PodmanTestIntegration) RunTopContainerWithArgs(name string, args []stri
803803
// RunLsContainer runs a simple container in the background that
804804
// simply runs ls. If the name passed != "", it will have a name
805805
func (p *PodmanTestIntegration) RunLsContainer(name string) (*PodmanSessionIntegration, int, string) {
806-
var podmanArgs = []string{"run"}
806+
podmanArgs := []string{"run"}
807807
if name != "" {
808808
podmanArgs = append(podmanArgs, "--name", name)
809809
}
@@ -822,7 +822,7 @@ func (p *PodmanTestIntegration) RunLsContainer(name string) (*PodmanSessionInteg
822822

823823
// RunNginxWithHealthCheck runs the alpine nginx container with an optional name and adds a healthcheck into it
824824
func (p *PodmanTestIntegration) RunNginxWithHealthCheck(name string) (*PodmanSessionIntegration, string) {
825-
var podmanArgs = []string{"run"}
825+
podmanArgs := []string{"run"}
826826
if name != "" {
827827
podmanArgs = append(podmanArgs, "--name", name)
828828
}
@@ -835,7 +835,7 @@ func (p *PodmanTestIntegration) RunNginxWithHealthCheck(name string) (*PodmanSes
835835

836836
// RunContainerWithNetworkTest runs the fedoraMinimal curl with the specified network mode.
837837
func (p *PodmanTestIntegration) RunContainerWithNetworkTest(mode string) *PodmanSessionIntegration {
838-
var podmanArgs = []string{"run"}
838+
podmanArgs := []string{"run"}
839839
if mode != "" {
840840
podmanArgs = append(podmanArgs, "--network", mode)
841841
}
@@ -845,7 +845,7 @@ func (p *PodmanTestIntegration) RunContainerWithNetworkTest(mode string) *Podman
845845
}
846846

847847
func (p *PodmanTestIntegration) RunLsContainerInPod(name, pod string) (*PodmanSessionIntegration, int, string) {
848-
var podmanArgs = []string{"run", "--pod", pod}
848+
podmanArgs := []string{"run", "--pod", pod}
849849
if name != "" {
850850
podmanArgs = append(podmanArgs, "--name", name)
851851
}
@@ -1006,7 +1006,7 @@ func (s *PodmanSessionIntegration) InspectPodArrToJSON() []define.InspectPodData
10061006
// CreatePod creates a pod with no infra container
10071007
// it optionally takes a pod name
10081008
func (p *PodmanTestIntegration) CreatePod(options map[string][]string) (*PodmanSessionIntegration, int, string) {
1009-
var args = []string{"pod", "create", "--infra=false", "--share", ""}
1009+
args := []string{"pod", "create", "--infra=false", "--share", ""}
10101010
for k, values := range options {
10111011
for _, v := range values {
10121012
args = append(args, k+"="+v)
@@ -1019,7 +1019,7 @@ func (p *PodmanTestIntegration) CreatePod(options map[string][]string) (*PodmanS
10191019
}
10201020

10211021
func (p *PodmanTestIntegration) CreateVolume(options map[string][]string) (*PodmanSessionIntegration, int, string) {
1022-
var args = []string{"volume", "create"}
1022+
args := []string{"volume", "create"}
10231023
for k, values := range options {
10241024
for _, v := range values {
10251025
args = append(args, k+"="+v)
@@ -1182,17 +1182,6 @@ func isRootless() bool {
11821182
return os.Geteuid() != 0
11831183
}
11841184

1185-
func isCgroupsV1() bool {
1186-
return !CGROUPSV2
1187-
}
1188-
1189-
func SkipIfCgroupV1(reason string) {
1190-
checkReason(reason)
1191-
if isCgroupsV1() {
1192-
Skip(reason)
1193-
}
1194-
}
1195-
11961185
func SkipIfCgroupV2(reason string) {
11971186
checkReason(reason)
11981187
if CGROUPSV2 {
@@ -1382,8 +1371,10 @@ func (p *PodmanTestIntegration) makeOptions(args []string, options PodmanExecOpt
13821371

13831372
podmanOptions = append(podmanOptions, strings.Split(p.StorageOptions, " ")...)
13841373
if !options.NoCache {
1385-
cacheOptions := []string{"--storage-opt",
1386-
fmt.Sprintf("%s.imagestore=%s", p.PodmanTest.ImageCacheFS, p.PodmanTest.ImageCacheDir)}
1374+
cacheOptions := []string{
1375+
"--storage-opt",
1376+
fmt.Sprintf("%s.imagestore=%s", p.PodmanTest.ImageCacheFS, p.PodmanTest.ImageCacheDir),
1377+
}
13871378
podmanOptions = append(cacheOptions, podmanOptions...)
13881379
}
13891380
podmanOptions = append(podmanOptions, args...)

test/e2e/containers_conf_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ import (
2020
)
2121

2222
var _ = Describe("Verify podman containers.conf usage", func() {
23-
2423
BeforeEach(func() {
2524
confPath, err := filepath.Abs("config/containers.conf")
2625
Expect(err).ToNot(HaveOccurred())
2726
os.Setenv("CONTAINERS_CONF", confPath)
2827
if IsRemote() {
2928
podmanTest.RestartRemoteService()
3029
}
31-
3230
})
3331

3432
It("limits test", func() {
@@ -55,7 +53,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
5553
} else {
5654
Expect(session.OutputToString()).To(Not(Equal("500")))
5755
}
58-
5956
})
6057

6158
It("oom-score-adj", func() {
@@ -85,15 +82,10 @@ var _ = Describe("Verify podman containers.conf usage", func() {
8582
} else {
8683
Expect(session.OutputToString()).To(ContainSubstring("0"))
8784
}
88-
8985
}
90-
9186
})
9287

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

814806
It("podman containers.conf container_name_as_hostname", func() {
815-
816807
// With default containers.conf
817808

818809
// Start container with no options

test/e2e/pod_create_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ ENTRYPOINT ["sleep","99999"]
768768
// Too complicated to differentiate in test context, so we ignore the first part
769769
// and just check for the "no container" substring, which is common to both.
770770
Expect(podCreate).Should(ExitWithError(125, `no container with name or ID "randomfakeid" found: no such container`))
771-
772771
})
773772

774773
It("podman pod create with --userns=keep-id", func() {
@@ -1045,7 +1044,6 @@ ENTRYPOINT ["sleep","99999"]
10451044
session.WaitWithDefaultTimeout()
10461045
Expect(session).Should(ExitCleanly())
10471046
Expect(session.OutputToString()).To(Equal("1:3"))
1048-
10491047
})
10501048

10511049
It("podman pod create --volumes-from", func() {
@@ -1154,7 +1152,6 @@ ENTRYPOINT ["sleep","99999"]
11541152

11551153
inspect := podmanTest.InspectContainer(ctrCreate.OutputToString())
11561154
Expect(inspect[0]).To(HaveField("AppArmorProfile", apparmor.Profile))
1157-
11581155
})
11591156

11601157
It("podman pod create --sysctl test", func() {
@@ -1192,12 +1189,10 @@ ENTRYPOINT ["sleep","99999"]
11921189
session.WaitWithDefaultTimeout()
11931190
Expect(session).Should(ExitCleanly())
11941191
Expect(session.OutputToString()).NotTo(ContainSubstring("kernel.msgmax = 65535"))
1195-
11961192
})
11971193

11981194
It("podman pod create --share-parent test", func() {
11991195
SkipIfRootlessCgroupsV1("rootless cannot use cgroups with cgroupsv1")
1200-
SkipIfCgroupV1("CgroupMode shows 'host' on CGv1, not CID (issue 15013, wontfix")
12011196
podCreate := podmanTest.Podman([]string{"pod", "create", "--share-parent=false"})
12021197
podCreate.WaitWithDefaultTimeout()
12031198
Expect(podCreate).Should(ExitCleanly())
@@ -1236,7 +1231,6 @@ ENTRYPOINT ["sleep","99999"]
12361231
podCreate3 := podmanTest.Podman([]string{"pod", "create", "--share", "cgroup"})
12371232
podCreate3.WaitWithDefaultTimeout()
12381233
Expect(podCreate3).ShouldNot(ExitCleanly())
1239-
12401234
})
12411235

12421236
It("podman pod create infra inheritance test", func() {

test/e2e/pod_stats_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ import (
99
)
1010

1111
var _ = Describe("Podman pod stats", func() {
12-
1312
BeforeEach(func() {
1413
SkipIfRootlessCgroupsV1("Tests fail with both CGv1 + required --cgroup-manager=cgroupfs")
15-
if isContainerized() {
16-
SkipIfCgroupV1("All tests fail Error: unable to load cgroup at ...: cgroup deleted")
17-
}
1814
})
1915

2016
It("podman pod stats should run with no pods", func() {

test/e2e/run_cgroup_parent_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
const cgroupRoot = "/sys/fs/cgroup"
1717

1818
var _ = Describe("Podman run with --cgroup-parent", func() {
19-
2019
BeforeEach(func() {
2120
SkipIfRootlessCgroupsV1("cgroup parent is not supported in cgroups v1")
2221
})
@@ -48,7 +47,6 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
4847
})
4948

5049
Specify("always honor --cgroup-parent", func() {
51-
SkipIfCgroupV1("test not supported in cgroups v1")
5250
if Containerized() || podmanTest.CgroupManager == "cgroupfs" {
5351
Skip("Requires Systemd cgroup manager support")
5452
}

test/e2e/run_cpu_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
)
1313

1414
var _ = Describe("Podman run cpu", func() {
15-
1615
BeforeEach(func() {
1716
SkipIfRootlessCgroupsV1("Setting CPU not supported on cgroupv1 for rootless users")
1817

@@ -121,15 +120,13 @@ var _ = Describe("Podman run cpu", func() {
121120
})
122121

123122
It("podman run invalid cpu-rt-period with cgroupsv2", func() {
124-
SkipIfCgroupV1("testing options that only work in cgroup v2")
125123
result := podmanTest.Podman([]string{"run", "--rm", "--cpu-rt-period=5000", ALPINE, "ls"})
126124
result.WaitWithDefaultTimeout()
127125
Expect(result).Should(Exit(0))
128126
Expect(result.ErrorToString()).To(ContainSubstring("Realtime period not supported on cgroups V2 systems"))
129127
})
130128

131129
It("podman run invalid cpu-rt-runtime with cgroupsv2", func() {
132-
SkipIfCgroupV1("testing options that only work in cgroup v2")
133130
result := podmanTest.Podman([]string{"run", "--rm", "--cpu-rt-runtime=5000", ALPINE, "ls"})
134131
result.WaitWithDefaultTimeout()
135132
Expect(result).Should(Exit(0))

test/e2e/run_memory_test.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@
33
package integration
44

55
import (
6-
"fmt"
7-
86
. "github.com/containers/podman/v5/test/utils"
97
. "github.com/onsi/ginkgo/v2"
108
. "github.com/onsi/gomega"
119
)
1210

1311
var _ = Describe("Podman run memory", func() {
14-
15-
BeforeEach(func() {
16-
SkipIfRootlessCgroupsV1("Setting Memory not supported on cgroupv1 for rootless users")
17-
})
18-
1912
It("podman run memory test", func() {
2013
var session *PodmanSessionIntegration
2114

@@ -61,17 +54,6 @@ var _ = Describe("Podman run memory", func() {
6154
Expect(session.OutputToString()).To(Equal(expect))
6255
})
6356

64-
for _, limit := range []string{"0", "15", "100"} {
65-
testName := fmt.Sprintf("podman run memory-swappiness test(%s)", limit)
66-
It(testName, func() {
67-
SkipIfCgroupV2("memory-swappiness not supported on cgroupV2")
68-
session := podmanTest.Podman([]string{"run", fmt.Sprintf("--memory-swappiness=%s", limit), ALPINE, "cat", "/sys/fs/cgroup/memory/memory.swappiness"})
69-
session.WaitWithDefaultTimeout()
70-
Expect(session).Should(ExitCleanly())
71-
Expect(session.OutputToString()).To(Equal(limit))
72-
})
73-
}
74-
7557
It("podman run memory test on oomkilled container", func() {
7658
mem := SystemExec("cat", []string{"/proc/sys/vm/overcommit_memory"})
7759
mem.WaitWithDefaultTimeout()

0 commit comments

Comments
 (0)