@@ -44,23 +44,26 @@ var (
44
44
vmNamePrefix = flag .String ("vm-name-prefix" , "gce-pd-csi-e2e" , "VM name prefix" )
45
45
architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
46
46
minCpuPlatform = flag .String ("min-cpu-platform" , "rome" , "Minimum CPU architecture" )
47
+ mwMinCpuPlatform = flag .String ("min-cpu-platform-mw" , "sapphirerapids" , "Minimum CPU architecture for multiwriter tests" )
47
48
zones = flag .String ("zones" , "us-east4-a,us-east4-c" , "Zones to run tests in. If there are multiple zones, separate each by comma" )
48
- machineType = flag .String ("machine-type" , "n2 -standard-2 " , "Type of machine to provision instance on" )
49
- imageURL = flag .String ("image-url" , "projects/debian- cloud/global/images/family/debian-11 " , "OS image url to get image from" )
49
+ machineType = flag .String ("machine-type" , "n2d -standard-4 " , "Type of machine to provision instance on" )
50
+ imageURL = flag .String ("image-url" , "projects/ubuntu-os- cloud/global/images/family/ubuntu-minimal-2404-lts-amd64 " , "OS image url to get image from" )
50
51
runInProw = flag .Bool ("run-in-prow" , false , "If true, use a Boskos loaned project and special CI service accounts and ssh keys" )
51
52
deleteInstances = flag .Bool ("delete-instances" , false , "Delete the instances after tests run" )
52
53
cloudtopHost = flag .Bool ("cloudtop-host" , false , "The local host is cloudtop, a kind of googler machine with special requirements to access GCP" )
53
54
extraDriverFlags = flag .String ("extra-driver-flags" , "" , "Extra flags to pass to the driver" )
54
55
enableConfidentialCompute = flag .Bool ("enable-confidential-compute" , false , "Create VMs with confidential compute mode. This uses NVMe devices" )
55
56
// Multi-writer is only supported on M3, C3, and N4
56
57
// https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms#hd-multi-writer
57
- hdMachineType = flag .String ("hyperdisk-machine-type" , "c3-standard-4" , "Type of machine to provision instance on" )
58
-
59
- testContexts = []* remote.TestContext {}
60
- computeService * compute.Service
61
- computeAlphaService * computealpha.Service
62
- computeBetaService * computebeta.Service
63
- kmsClient * cloudkms.KeyManagementClient
58
+ hdMachineType = flag .String ("hyperdisk-machine-type" , "c3-standard-4" , "Type of machine to provision instance on" )
59
+ hdMinCpuPlatform = flag .String ("hyperdisk-min-cpu-platform" , "sapphirerapids" , "Minimum CPU architecture" )
60
+
61
+ testContexts = []* remote.TestContext {}
62
+ hyperdiskTestContexts = []* remote.TestContext {}
63
+ computeService * compute.Service
64
+ computeAlphaService * computealpha.Service
65
+ computeBetaService * computebeta.Service
66
+ kmsClient * cloudkms.KeyManagementClient
64
67
)
65
68
66
69
func init () {
@@ -78,7 +81,9 @@ var _ = BeforeSuite(func() {
78
81
numberOfInstancesPerZone := 2
79
82
zones := strings .Split (* zones , "," )
80
83
tcc := make (chan * remote.TestContext , len (zones )* numberOfInstancesPerZone )
84
+ hdtcc := make (chan * remote.TestContext , len (zones ))
81
85
defer close (tcc )
86
+ defer close (hdtcc )
82
87
83
88
rand .Seed (time .Now ().UnixNano ())
84
89
@@ -115,6 +120,13 @@ var _ = BeforeSuite(func() {
115
120
tcc <- NewDefaultTestContext (curZone , strconv .Itoa (randInt ))
116
121
}(zone , j )
117
122
}
123
+ go func (curZone string ) {
124
+ wg .Add (1 )
125
+ defer GinkgoRecover ()
126
+ defer wg .Done ()
127
+ hdtcc <- NewTestContext (curZone , * hdMinCpuPlatform , * hdMachineType , "0" )
128
+ }(zone )
129
+ wg .Wait ()
118
130
}
119
131
120
132
for _ , zone := range zones {
@@ -126,6 +138,11 @@ var _ = BeforeSuite(func() {
126
138
testContexts = append (testContexts , tc )
127
139
klog .Infof ("Added TestContext for node %s" , tc .Instance .GetName ())
128
140
}
141
+ for i := 0 ; i < len (zones ); i ++ {
142
+ tc := <- hdtcc
143
+ hyperdiskTestContexts = append (hyperdiskTestContexts , tc )
144
+ klog .Infof ("Added TestContext for node %s" , tc .Instance .GetName ())
145
+ }
129
146
})
130
147
131
148
var _ = AfterSuite (func () {
@@ -136,6 +153,13 @@ var _ = AfterSuite(func() {
136
153
tc .Instance .DeleteInstance ()
137
154
}
138
155
}
156
+ for _ , mwTc := range hyperdiskTestContexts {
157
+ err := remote .TeardownDriverAndClient (mwTc )
158
+ Expect (err ).To (BeNil (), "Multiwriter Teardown Driver and Client failed with error" )
159
+ if * deleteInstances {
160
+ mwTc .Instance .DeleteInstance ()
161
+ }
162
+ }
139
163
})
140
164
141
165
func notEmpty (v string ) bool {
@@ -220,3 +244,9 @@ func getRandomTestContext() *remote.TestContext {
220
244
rn := rand .Intn (len (testContexts ))
221
245
return testContexts [rn ]
222
246
}
247
+
248
+ func getRandomMwTestContext () * remote.TestContext {
249
+ Expect (hyperdiskTestContexts ).ToNot (BeEmpty ())
250
+ rn := rand .Intn (len (hyperdiskTestContexts ))
251
+ return hyperdiskTestContexts [rn ]
252
+ }
0 commit comments