Skip to content

Commit

Permalink
Test was failing in case of coldplug + nondisk combination due missin…
Browse files Browse the repository at this point in the history
…g property definiton.

For not hotplug will now start the VM in case of disk only if the disk attachment was successful. in case of other test_devices the VM should start
  • Loading branch information
hholoubk committed Sep 20, 2024
1 parent 59792ec commit 1c0d608
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def attach_device(vm, test_device, dev_dict):
:param vm: VM instance
:param test_device: the device type, e.g. disk
:param dev_dict: the device definition
:return: CmdResult object
"""

dev_obj = libvirt_vmxml.create_vm_device_by_type(test_device, dev_dict)
Expand Down Expand Up @@ -78,6 +79,7 @@ def run(test, params, env):
dev_dict, seclabel_attr = get_dev_dict(test_device, params)
test.log.debug("The device setting will be updated to %s.", dev_dict)
try:
res = None
if test_scenario != "hot_plug":
test.log.info("TEST_STEP: Start VM with per-device dac setting.")
try:
Expand All @@ -89,7 +91,9 @@ def run(test, params, env):
if not status_error:
test.fail(details)
test.log.debug("VM XML: %s.", VMXML.new_from_inactive_dumpxml(vm_name))
if res.exit_status == 0:
# res is None in case of non disk device and the VM should be started
# in case of disk, the VM should be started only in successful attach.
if res is None or res.exit_status == 0:
res = virsh.start(vm.name)
else:
test.log.info("TEST_STEP: Hot plug a device with dac setting.")
Expand Down

0 comments on commit 1c0d608

Please sign in to comment.