Skip to content

Commit 382c9fa

Browse files
committed
WIP install 4/n: insertion of install ISO as CD
FIXME: or not, since it's harder to modify CD booting than using PXE
1 parent 2ac66c2 commit 382c9fa

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/vm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,16 @@ 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+
logging.info("New VBD %s", vbd_uuid)
498+
return VBD(vbd_uuid, self, device)
499+
490500
def clone(self):
491501
name = self.name() + '_clone_for_tests'
492502
logging.info("Clone VM")

tests/install/test_install.py

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

0 commit comments

Comments
 (0)