Skip to content

Commit 3884bf4

Browse files
committed
test/e2e/common.go: fix disk_offering_test.go
• [FAILED] [292.946 seconds] When testing with disk offering [It] Should successfully create a cluster with disk offering /data/git/cluster-api-provider-cloudstack/test/e2e/disk_offering.go:60 [FAILED] Expected <string>: to equal <string>: Small In [It] at: /data/git/cluster-api-provider-cloudstack/test/e2e/common.go:515 The error is because diskofferingname of VM is not the offering name of DATA disks. It is the offering name of ROOT disk only when the VM is created from ISO. The test passes if check the offering name of DATA disks instead.
1 parent 4d7274d commit 3884bf4

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)