@@ -241,12 +241,23 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
241241 Expect (len (machineSets .Items )).ShouldNot (Equal (0 ))
242242
243243 machineSet := machineSets .Items [0 ]
244+ origReplicas := int (* machineSet .Spec .Replicas )
244245
245246 // scale up new machine and wait for scale up to complete
246247 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 )
248249 Expect (err ).NotTo (HaveOccurred ())
249250
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+
250261 nodes , err = c .CoreV1 ().Nodes ().List (ctx , v1.ListOptions {})
251262 Expect (err ).NotTo (HaveOccurred ())
252263
@@ -272,5 +283,20 @@ var _ = Describe("[sig-cluster-lifecycle][OCPFeatureGate:VSphereMultiNetworks][p
272283 failIfNodeNetworkingInconsistentWithMachineNetwork (infra .Spec .PlatformSpec , machineNetworks )
273284 failIfMachinesDoNotHaveAllPortgroups (infra .Spec .PlatformSpec , machines )
274285 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 ))
275301 })
276302})
0 commit comments