@@ -210,6 +210,7 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
210
210
211
211
var pandoraSyncWaitTime int
212
212
var err error
213
+ var vmIp string
213
214
curtime := time .Now ().Unix ()
214
215
curtimestring := strconv .FormatInt (curtime , 10 )
215
216
pvcName := "cns-pvc-" + curtimestring
@@ -303,26 +304,26 @@ var _ bool = ginkgo.Describe("[vmsvc] vm service with csi vol tests", func() {
303
304
gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
304
305
}()
305
306
306
- ginkgo .By ("Wait for VM to come up and get an IP" )
307
- vmIp , err := waitNgetVmsvcVmIp (ctx , vmopC , namespace , vm .Name )
308
- gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
307
+ isPrivateNetwork := GetBoolEnvVarOrDefault ("IS_PRIVATE_NETWORK" , false )
308
+ if ! isPrivateNetwork {
309
+ ginkgo .By ("Wait for VM to come up and get an IP" )
310
+ vmIp , err = waitNgetVmsvcVmIp (ctx , vmopC , namespace , vm .Name )
311
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
309
312
310
- ginkgo .By ("Wait and verify PVCs are attached to the VM" )
311
- gomega .Expect (waitNverifyPvcsAreAttachedToVmsvcVm (ctx , vmopC , cnsopC , vm ,
312
- []* v1.PersistentVolumeClaim {pvc , staticPvc })).NotTo (gomega .HaveOccurred ())
313
+ ginkgo .By ("Wait and verify PVCs are attached to the VM" )
314
+ gomega .Expect (waitNverifyPvcsAreAttachedToVmsvcVm (ctx , vmopC , cnsopC , vm ,
315
+ []* v1.PersistentVolumeClaim {pvc , staticPvc })).NotTo (gomega .HaveOccurred ())
313
316
314
- if latebinding {
315
- ginkgo .By ("Validating that the PVC transitions to Bound state after the " +
316
- "volume is attached to the VM using a late-binding storage policy" )
317
- pvs , err := fpv .WaitForPVClaimBoundPhase (ctx , client , []* v1.PersistentVolumeClaim {pvc , staticPvc }, pollTimeout )
318
- gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
319
- pv := pvs [0 ]
320
- volHandle = pv .Spec .CSI .VolumeHandle
321
- gomega .Expect (volHandle ).NotTo (gomega .BeEmpty ())
322
- }
317
+ if latebinding {
318
+ ginkgo .By ("Validating that the PVC transitions to Bound state after the " +
319
+ "volume is attached to the VM using a late-binding storage policy" )
320
+ pvs , err := fpv .WaitForPVClaimBoundPhase (ctx , client , []* v1.PersistentVolumeClaim {pvc , staticPvc }, pollTimeout )
321
+ gomega .Expect (err ).NotTo (gomega .HaveOccurred ())
322
+ pv := pvs [0 ]
323
+ volHandle = pv .Spec .CSI .VolumeHandle
324
+ gomega .Expect (volHandle ).NotTo (gomega .BeEmpty ())
325
+ }
323
326
324
- isPrivateNetwork := GetBoolEnvVarOrDefault ("IS_PRIVATE_NETWORK" , false )
325
- if ! isPrivateNetwork {
326
327
ginkgo .By ("Verify PVCs are accessible to the VM" )
327
328
ginkgo .By ("Write some IO to the CSI volumes and read it back from them and verify the data integrity" )
328
329
vm , err = getVmsvcVM (ctx , vmopC , vm .Namespace , vm .Name ) // refresh vm info
0 commit comments