Skip to content

Commit df05671

Browse files
committed
install: support installing with several VDIs attached
The helper_vm_with_plugged_disk fixture for tune_firstboot was only able to attach a single disk. For RAID support we need several disks, and that fixture would fail. Signed-off-by: Yann Dirson <[email protected]>
1 parent 1487351 commit df05671

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/install/test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@ def helper_vm_with_plugged_disk(running_vm, create_vms):
2626

2727
all_vdis = [VDI(uuid, host=host_vm.host) for uuid in host_vm.vdi_uuids()]
2828
disk_vdis = [vdi for vdi in all_vdis if not vdi.readonly()]
29-
vdi, = disk_vdis
3029

31-
vbd = helper_vm.create_vbd("1", vdi.uuid)
30+
vbds = [helper_vm.create_vbd(str(n + 1), vdi.uuid) for n, vdi in enumerate(disk_vdis)]
3231
try:
33-
vbd.plug()
32+
for vbd in vbds:
33+
vbd.plug()
3434

3535
yield helper_vm
3636

3737
finally:
38-
vbd.unplug()
39-
vbd.destroy()
38+
for vbd in reversed(vbds):
39+
vbd.unplug()
40+
vbd.destroy()
4041

4142
@pytest.mark.dependency()
4243
class TestNested:

0 commit comments

Comments
 (0)