Skip to content

Commit

Permalink
svirt/selinux/per_device: return if expected error is found
Browse files Browse the repository at this point in the history
`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 <[email protected]>
  • Loading branch information
smitterl committed Sep 13, 2024
1 parent 8a4c614 commit 1ddaaeb
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1ddaaeb

Please sign in to comment.