@@ -36,25 +36,24 @@ import (
36
36
)
37
37
38
38
var (
39
- project = flag .String ("project" , "" , "Project to run tests in" )
40
- serviceAccount = flag .String ("service-account" , "" , "Service account to bring up instance with" )
41
- vmNamePrefix = flag .String ("vm-name-prefix" , "gce-pd-csi-e2e" , "VM name prefix" )
42
- architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
43
- minCpuPlatform = flag .String ("min-cpu-platform" , "rome" , "Minimum CPU architecture" )
44
- mwMinCpuPlatform = flag .String ("min-cpu-platform-mw" , "sapphirerapids" , "Minimum CPU architecture for multiwriter tests" )
45
- zones = flag .String ("zones" , "us-east4-a,us-east4-c" , "Zones to run tests in. If there are multiple zones, separate each by comma" )
46
- machineType = flag .String ("machine-type" , "n2d-standard-4" , "Type of machine to provision instance on" )
47
- // Multi-writer is only supported on M3, C3, and N4
48
- // https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms#hd-multi-writer
49
- mwMachineType = flag .String ("mw-machine-type" , "c3-standard-4" , "Type of machine to provision instance for multiwriter tests" )
39
+ project = flag .String ("project" , "" , "Project to run tests in" )
40
+ serviceAccount = flag .String ("service-account" , "" , "Service account to bring up instance with" )
41
+ vmNamePrefix = flag .String ("vm-name-prefix" , "gce-pd-csi-e2e" , "VM name prefix" )
42
+ architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
43
+ minCpuPlatform = flag .String ("min-cpu-platform" , "rome" , "Minimum CPU architecture" )
44
+ mwMinCpuPlatform = flag .String ("min-cpu-platform-mw" , "sapphirerapids" , "Minimum CPU architecture for multiwriter tests" )
45
+ zones = flag .String ("zones" , "us-east4-a,us-east4-c" , "Zones to run tests in. If there are multiple zones, separate each by comma" )
46
+ machineType = flag .String ("machine-type" , "n2d-standard-4" , "Type of machine to provision instance on" )
50
47
imageURL = flag .String ("image-url" , "projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2404-lts-amd64" , "OS image url to get image from" )
51
48
runInProw = flag .Bool ("run-in-prow" , false , "If true, use a Boskos loaned project and special CI service accounts and ssh keys" )
52
49
deleteInstances = flag .Bool ("delete-instances" , false , "Delete the instances after tests run" )
53
50
cloudtopHost = flag .Bool ("cloudtop-host" , false , "The local host is cloudtop, a kind of googler machine with special requirements to access GCP" )
54
51
extraDriverFlags = flag .String ("extra-driver-flags" , "" , "Extra flags to pass to the driver" )
55
52
enableConfidentialCompute = flag .Bool ("enable-confidential-compute" , false , "Create VMs with confidential compute mode. This uses NVMe devices" )
56
- hdMachineType = flag .String ("hyperdisk-machine-type" , "c3-standard-4" , "Type of machine to provision instance on" )
57
- hdMinCpuPlatform = flag .String ("hyperdisk-min-cpu-platform" , "sapphirerapids" , "Minimum CPU architecture" )
53
+ // Multi-writer is only supported on M3, C3, and N4
54
+ // https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms#hd-multi-writer
55
+ hdMachineType = flag .String ("hyperdisk-machine-type" , "c3-standard-4" , "Type of machine to provision instance on" )
56
+ hdMinCpuPlatform = flag .String ("hyperdisk-min-cpu-platform" , "sapphirerapids" , "Minimum CPU architecture" )
58
57
59
58
testContexts = []* remote.TestContext {}
60
59
hyperdiskTestContexts = []* remote.TestContext {}
@@ -77,9 +76,9 @@ func TestE2E(t *testing.T) {
77
76
var _ = BeforeSuite (func () {
78
77
var err error
79
78
tcc := make (chan * remote.TestContext )
80
- mwTcc := make (chan * remote.TestContext )
79
+ hdtcc := make (chan * remote.TestContext )
81
80
defer close (tcc )
82
- defer close (mwTcc )
81
+ defer close (hdtcc )
83
82
84
83
zones := strings .Split (* zones , "," )
85
84
@@ -110,16 +109,17 @@ var _ = BeforeSuite(func() {
110
109
for _ , zone := range zones {
111
110
go func (curZone string ) {
112
111
defer GinkgoRecover ()
113
- tcc <- NewTestContext (curZone , * machineType , * minCpuPlatform )
114
- mwTcc <- NewTestContext (curZone , * mwMachineType , * mwMinCpuPlatform )
112
+ tcc <- NewDefaultTestContext (curZone )
113
+ }(zone )
114
+ go func (curZone string ) {
115
+ defer GinkgoRecover ()
116
+ hdtcc <- NewTestContext (curZone , * hdMinCpuPlatform , * hdMachineType )
115
117
}(zone )
116
118
}
117
119
118
120
for i := 0 ; i < len (zones ); i ++ {
119
121
tc := <- tcc
120
122
testContexts = append (testContexts , tc )
121
- mwTc := <- mwTcc
122
- multiWriterTestContexts = append (multiWriterTestContexts , mwTc )
123
123
klog .Infof ("Added TestContext for node %s" , tc .Instance .GetName ())
124
124
tc = <- hdtcc
125
125
hyperdiskTestContexts = append (hyperdiskTestContexts , tc )
@@ -135,7 +135,7 @@ var _ = AfterSuite(func() {
135
135
tc .Instance .DeleteInstance ()
136
136
}
137
137
}
138
- for _ , mwTc := range multiWriterTestContexts {
138
+ for _ , mwTc := range hyperdiskTestContexts {
139
139
err := remote .TeardownDriverAndClient (mwTc )
140
140
Expect (err ).To (BeNil (), "Multiwriter Teardown Driver and Client failed with error" )
141
141
if * deleteInstances {
@@ -212,7 +212,7 @@ func getRandomTestContext() *remote.TestContext {
212
212
return testContexts [rn ]
213
213
}
214
214
func getRandomMwTestContext () * remote.TestContext {
215
- Expect (multiWriterTestContexts ).ToNot (BeEmpty ())
216
- rn := rand .Intn (len (multiWriterTestContexts ))
217
- return multiWriterTestContexts [rn ]
215
+ Expect (hyperdiskTestContexts ).ToNot (BeEmpty ())
216
+ rn := rand .Intn (len (hyperdiskTestContexts ))
217
+ return hyperdiskTestContexts [rn ]
218
218
}
0 commit comments