Skip to content

Commit

Permalink
Fix tests failing due to disks not bootable
Browse files Browse the repository at this point in the history
Following tests were failing on live backend due to VMs not being able to start
because the disks created during the execution were not bootable and were
not activated:

TestNegativeVMAffinityShouldResultInDifferenHosts
TestDiskRemoveFromRunningVMShouldResultInError
TestVMStartStop
  • Loading branch information
Darth-Mera authored and Janos Bonic committed Jun 30, 2022
1 parent 7cecd13 commit 9071788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion disk_remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestDiskRemoveFromRunningVMShouldResultInError(t *testing.T) {
helper := getHelper(t)
disk := assertCanCreateDisk(t, helper)
vm := assertCanCreateVM(t, helper, fmt.Sprintf("test-%s", helper.GenerateRandomID(5)), nil)
assertCanAttachDisk(t, vm, disk)
assertCanAttachDiskWithParams(t, vm, disk, ovirtclient.CreateDiskAttachmentParams().MustWithBootable(true).MustWithActive(true))
assertCanStartVM(t, helper, vm)
if err := disk.Remove(ovirtclient.MaxTries(5)); err == nil {
t.Fatalf("Removing a disk from a running VM did not result in an error.")
Expand Down
4 changes: 2 additions & 2 deletions vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func TestVMStartStop(t *testing.T) {
nil,
)
disk := assertCanCreateDisk(t, helper)
assertCanAttachDisk(t, vm, disk)
assertCanAttachDiskWithParams(t, vm, disk, ovirtclient.CreateDiskAttachmentParams().MustWithBootable(true).MustWithActive(true))
assertCanUploadDiskImage(t, helper, disk)
assertCanStartVM(t, helper, vm)
assertVMWillStart(t, vm)
Expand Down Expand Up @@ -923,6 +923,6 @@ func assertCanCreateBootableVM(t *testing.T, helper ovirtclient.TestHelper) ovir
)
disk1 := assertCanCreateDisk(t, helper)
assertCanUploadDiskImage(t, helper, disk1)
assertCanAttachDisk(t, vm1, disk1)
assertCanAttachDiskWithParams(t, vm1, disk1, ovirtclient.CreateDiskAttachmentParams().MustWithBootable(true).MustWithActive(true))
return vm1
}

0 comments on commit 9071788

Please sign in to comment.