Skip to content

Commit 09fada9

Browse files
committed
WIP install 4/n: insertion of install ISO as CD
TODO: - hardcoded values, move to vdis[]
1 parent d8d56db commit 09fada9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/vm.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,18 @@ def create_vbd(self, device, vdi_uuid):
487487
logging.info("New VBD %s", vbd_uuid)
488488
return VBD(vbd_uuid, self, device)
489489

490+
def create_cd_vbd(self, device):
491+
logging.info("Create CD VBD %r on VM %s", device, self.uuid)
492+
vbd_uuid = self.host.xe('vbd-create', {'vm-uuid': self.uuid,
493+
'device': device,
494+
'type': 'CD',
495+
'mode': 'RO',
496+
})
497+
vbd = VBD(vbd_uuid, self, device)
498+
vbd.param_set(param_name="userdevice", value="3") # FIXME
499+
logging.info("New VBD %s", vbd_uuid)
500+
return vbd
501+
490502
def clone(self):
491503
name = self.name() + '_clone_for_tests'
492504
logging.info("Clone VM")

tests/install/test_install.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
))
99
class TestInstallNested:
1010
def test_install_nested_821_uefi(self, create_vms):
11-
pass
11+
assert len(create_vms) == 1
12+
host_vm = create_vms[0]
13+
14+
host_vm.create_cd_vbd("xvdd")
15+
host_vm.insert_cd("xcp-ng-8.2.1-20231130.iso")

0 commit comments

Comments
 (0)