@@ -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"
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
@@ -784,7 +782,7 @@ func (p *PodmanTestIntegration) RunTopContainer(name string) *PodmanSessionInteg
784782// runs top. If the name passed != "", it will have a name, command args can also be passed in
785783func (p * PodmanTestIntegration ) RunTopContainerWithArgs (name string , args []string ) * PodmanSessionIntegration {
786784 // In proxy environment, some tests need to the --http-proxy=false option (#16684)
787- var podmanArgs = []string {"run" , "--http-proxy=false" }
785+ podmanArgs : = []string {"run" , "--http-proxy=false" }
788786 if name != "" {
789787 podmanArgs = append (podmanArgs , "--name" , name )
790788 }
@@ -803,7 +801,7 @@ func (p *PodmanTestIntegration) RunTopContainerWithArgs(name string, args []stri
803801// RunLsContainer runs a simple container in the background that
804802// simply runs ls. If the name passed != "", it will have a name
805803func (p * PodmanTestIntegration ) RunLsContainer (name string ) (* PodmanSessionIntegration , int , string ) {
806- var podmanArgs = []string {"run" }
804+ podmanArgs : = []string {"run" }
807805 if name != "" {
808806 podmanArgs = append (podmanArgs , "--name" , name )
809807 }
@@ -822,7 +820,7 @@ func (p *PodmanTestIntegration) RunLsContainer(name string) (*PodmanSessionInteg
822820
823821// RunNginxWithHealthCheck runs the alpine nginx container with an optional name and adds a healthcheck into it
824822func (p * PodmanTestIntegration ) RunNginxWithHealthCheck (name string ) (* PodmanSessionIntegration , string ) {
825- var podmanArgs = []string {"run" }
823+ podmanArgs : = []string {"run" }
826824 if name != "" {
827825 podmanArgs = append (podmanArgs , "--name" , name )
828826 }
@@ -835,7 +833,7 @@ func (p *PodmanTestIntegration) RunNginxWithHealthCheck(name string) (*PodmanSes
835833
836834// RunContainerWithNetworkTest runs the fedoraMinimal curl with the specified network mode.
837835func (p * PodmanTestIntegration ) RunContainerWithNetworkTest (mode string ) * PodmanSessionIntegration {
838- var podmanArgs = []string {"run" }
836+ podmanArgs : = []string {"run" }
839837 if mode != "" {
840838 podmanArgs = append (podmanArgs , "--network" , mode )
841839 }
@@ -845,7 +843,7 @@ func (p *PodmanTestIntegration) RunContainerWithNetworkTest(mode string) *Podman
845843}
846844
847845func (p * PodmanTestIntegration ) RunLsContainerInPod (name , pod string ) (* PodmanSessionIntegration , int , string ) {
848- var podmanArgs = []string {"run" , "--pod" , pod }
846+ podmanArgs : = []string {"run" , "--pod" , pod }
849847 if name != "" {
850848 podmanArgs = append (podmanArgs , "--name" , name )
851849 }
@@ -1006,7 +1004,7 @@ func (s *PodmanSessionIntegration) InspectPodArrToJSON() []define.InspectPodData
10061004// CreatePod creates a pod with no infra container
10071005// it optionally takes a pod name
10081006func (p * PodmanTestIntegration ) CreatePod (options map [string ][]string ) (* PodmanSessionIntegration , int , string ) {
1009- var args = []string {"pod" , "create" , "--infra=false" , "--share" , "" }
1007+ args : = []string {"pod" , "create" , "--infra=false" , "--share" , "" }
10101008 for k , values := range options {
10111009 for _ , v := range values {
10121010 args = append (args , k + "=" + v )
@@ -1019,7 +1017,7 @@ func (p *PodmanTestIntegration) CreatePod(options map[string][]string) (*PodmanS
10191017}
10201018
10211019func (p * PodmanTestIntegration ) CreateVolume (options map [string ][]string ) (* PodmanSessionIntegration , int , string ) {
1022- var args = []string {"volume" , "create" }
1020+ args : = []string {"volume" , "create" }
10231021 for k , values := range options {
10241022 for _ , v := range values {
10251023 args = append (args , k + "=" + v )
@@ -1083,13 +1081,6 @@ func SkipIfRunc(p *PodmanTestIntegration, reason string) {
10831081 }
10841082}
10851083
1086- func SkipIfRootlessCgroupsV1 (reason string ) {
1087- checkReason (reason )
1088- if isRootless () && ! CGROUPSV2 {
1089- Skip ("[rootless]: " + reason )
1090- }
1091- }
1092-
10931084func SkipIfRootless (reason string ) {
10941085 checkReason (reason )
10951086 if isRootless () {
@@ -1182,24 +1173,6 @@ func isRootless() bool {
11821173 return os .Geteuid () != 0
11831174}
11841175
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-
1196- func SkipIfCgroupV2 (reason string ) {
1197- checkReason (reason )
1198- if CGROUPSV2 {
1199- Skip (reason )
1200- }
1201- }
1202-
12031176func isContainerized () bool {
12041177 // This is set to "podman" by podman automatically
12051178 return os .Getenv ("container" ) != ""
@@ -1382,8 +1355,10 @@ func (p *PodmanTestIntegration) makeOptions(args []string, options PodmanExecOpt
13821355
13831356 podmanOptions = append (podmanOptions , strings .Split (p .StorageOptions , " " )... )
13841357 if ! options .NoCache {
1385- cacheOptions := []string {"--storage-opt" ,
1386- fmt .Sprintf ("%s.imagestore=%s" , p .PodmanTest .ImageCacheFS , p .PodmanTest .ImageCacheDir )}
1358+ cacheOptions := []string {
1359+ "--storage-opt" ,
1360+ fmt .Sprintf ("%s.imagestore=%s" , p .PodmanTest .ImageCacheFS , p .PodmanTest .ImageCacheDir ),
1361+ }
13871362 podmanOptions = append (cacheOptions , podmanOptions ... )
13881363 }
13891364 podmanOptions = append (podmanOptions , args ... )
0 commit comments