Skip to content

Commit 980b829

Browse files
committed
VM: fix name of method dealing with CD insertion, provide a generic API
"vm-cd-insert" does not mount anything, as the need for a subsequent "mount" in the only test using it shows. Signed-off-by: Yann Dirson <[email protected]>
1 parent e27037f commit 980b829

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/vm.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,13 @@ def detect_package_manager(self):
334334
else:
335335
return PackageManagerEnum.UNKNOWN
336336

337-
def mount_guest_tools_iso(self):
338-
self.host.xe('vm-cd-insert', {'uuid': self.uuid, 'cd-name': 'guest-tools.iso'})
337+
def insert_cd(self, vdi_name):
338+
self.host.xe('vm-cd-insert', {'uuid': self.uuid, 'cd-name': vdi_name})
339339

340-
def unmount_guest_tools_iso(self):
340+
def insert_guest_tools_iso(self):
341+
self.insert_cd('guest-tools.iso')
342+
343+
def eject_cd(self):
341344
self.host.xe('vm-cd-eject', {'uuid': self.uuid})
342345

343346
# *** Common reusable test fragments

tests/guest-tools/unix/test_guest_tools_unix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_install(self, running_vm, state):
6262

6363
# mount ISO
6464
logging.info("Mount guest tools ISO")
65-
vm.mount_guest_tools_iso()
65+
vm.insert_guest_tools_iso()
6666
tmp_mnt = vm.ssh(['mktemp', '-d'])
6767
time.sleep(2) # wait a small amount of time just to ensure the device is available
6868
vm.ssh(['mount', '-t', 'iso9660', '/dev/cdrom', tmp_mnt])
@@ -80,7 +80,7 @@ def test_install(self, running_vm, state):
8080
# unmount ISO
8181
logging.info("Unmount guest tools ISO")
8282
vm.ssh(['umount', tmp_mnt])
83-
vm.unmount_guest_tools_iso()
83+
vm.eject_cd()
8484

8585
# check that xe-daemon is running
8686
wait_for(lambda: vm.ssh_with_result(['pgrep', '-f', 'xe-daemon']).returncode == 0,

0 commit comments

Comments
 (0)