@@ -241,12 +241,23 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
241
241
Expect (len (machineSets .Items )).ShouldNot (Equal (0 ))
242
242
243
243
machineSet := machineSets .Items [0 ]
244
+ origReplicas := int (* machineSet .Spec .Replicas )
244
245
245
246
// scale up new machine and wait for scale up to complete
246
247
By ("scaling up a new machineset which should have multiple NICs" )
247
- err = e2eutil .ScaleMachineSet (cfg , machineSet .Name , int ( * machineSet . Spec . Replicas ) + 1 )
248
+ err = e2eutil .ScaleMachineSet (cfg , machineSet .Name , origReplicas + 1 )
248
249
Expect (err ).NotTo (HaveOccurred ())
249
250
251
+ // Verify / wait for machine is ready
252
+ By ("verifying machine became ready" )
253
+ Eventually (func () (int32 , error ) {
254
+ ms , err := mc .MachineSets (e2eutil .MachineAPINamespace ).Get (ctx , machineSet .Name , metav1.GetOptions {})
255
+ if err != nil {
256
+ return - 1 , err
257
+ }
258
+ return ms .Status .ReadyReplicas , nil
259
+ }, machineReadyTimeout ).Should (BeEquivalentTo (origReplicas + 1 ))
260
+
250
261
nodes , err = c .CoreV1 ().Nodes ().List (ctx , v1.ListOptions {})
251
262
Expect (err ).NotTo (HaveOccurred ())
252
263
@@ -272,5 +283,20 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
272
283
failIfNodeNetworkingInconsistentWithMachineNetwork (infra .Spec .PlatformSpec , machineNetworks )
273
284
failIfMachinesDoNotHaveAllPortgroups (infra .Spec .PlatformSpec , machines )
274
285
failIfIncorrectPortgroupsAttachedToVMs (ctx , infra , nodes , vsphereCreds )
286
+
287
+ // Scale down machineset
288
+ By ("scaling down the machineset" )
289
+ err = e2eutil .ScaleMachineSet (cfg , machineSet .Name , origReplicas )
290
+ Expect (err ).NotTo (HaveOccurred ())
291
+
292
+ // Verify / wait for machine is removed
293
+ By ("verifying machine is destroyed" )
294
+ Eventually (func () (int32 , error ) {
295
+ ms , err := mc .MachineSets (e2eutil .MachineAPINamespace ).Get (ctx , machineSet .Name , metav1.GetOptions {})
296
+ if err != nil {
297
+ return - 1 , err
298
+ }
299
+ return ms .Status .ReadyReplicas , nil
300
+ }, machineReadyTimeout ).Should (BeEquivalentTo (origReplicas ))
275
301
})
276
302
})
0 commit comments