Skip to content

Commit 072e1dc

Browse files
authored
Merge pull request #247 from weizhouapache/e2e-fix-disk_offering_test
e2e: fix disk_offering_test.go
2 parents 242e3ad + 3884bf4 commit 072e1dc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/e2e/common.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,17 @@ func CheckDiskOfferingOfVmInstances(client *cloudstack.CloudStackClient, cluster
512512
}
513513
for _, vm := range listResp.VirtualMachines {
514514
if strings.Contains(vm.Name, clusterName) {
515-
Expect(vm.Diskofferingname).To(Equal(diskOfferingName))
515+
p := client.Volume.NewListVolumesParams()
516+
p.SetVirtualmachineid(vm.Id)
517+
volResp, err := client.Volume.ListVolumes(p)
518+
if err != nil {
519+
Fail(fmt.Sprintf("Failed to list volumes for VM instance %s", vm.Id))
520+
}
521+
for _, vol := range volResp.Volumes {
522+
if strings.Contains(vol.Name, DataVolumePrefix) {
523+
Expect(vol.Diskofferingname).To(Equal(diskOfferingName))
524+
}
525+
}
516526
}
517527
}
518528
}

0 commit comments

Comments
 (0)