From 1ddaaebb44f290f91182edc2afbe2c5cbcca732c Mon Sep 17 00:00:00 2001 From: Sebastian Mitterle Date: Fri, 13 Sep 2024 11:30:36 -0400 Subject: [PATCH] svirt/selinux/per_device: return if expected error is found `status_error` expected to be `yes` on invalid configuration, that is, either during xml setup a) through `vmxml.sync` which undefines and tries to define the VM, or b) through attach through `virsh.attach_device`. Both will raise LibvirtXMLError on failure. So, if as expected this error is raised for coldplug, we can stop the test execution by returning and considering the test PASS. Signed-off-by: Sebastian Mitterle --- libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py b/libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py index e3fcd426bc..760dea7b06 100644 --- a/libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py +++ b/libvirt/tests/src/svirt/selinux/selinux_seclabel_per_device.py @@ -88,6 +88,8 @@ def run(test, params, env): except xcepts.LibvirtXMLError as details: if not status_error: test.fail(details) + else: + return test.log.debug("VM XML: %s.", VMXML.new_from_inactive_dumpxml(vm_name)) if not ('res' in locals() and res.exit_status != 0): res = virsh.start(vm.name)