On 03/05/2013 12:39 PM, Chris Evich wrote:
On 03/05/2013 10:07 AM, Lucas Meneghel Rodrigues wrote:
+ # This is the last real chance we have to check whether
+ # the vm userspace crashed. Raising exceptions during
vm.destroy() might
+ # prevent some cleanup from happening.
+ vm.verify_userspace_crash()
if params.get("kill_vm") == "yes":
kill_vm_timeout = float(params.get("kill_vm_timeout", 0))
if kill_vm_timeout:
I'm not sure if this is the best place to catch these in the case of
tests which change the VM state internally (migration, save/restore,
reboot, etc.) and/or do so multiple times.
One spot in common between all, could be vm.destroy(). What about
sticking the the crash-detection in there (i.e. before actually
destroying the VM)?
It could be done, just need to take extra care to ensure cleanup is
fully done before raising the exception.
This would also have the benefit of catching failures EARLIER, and
checking more frequently. Rather than just checking once, possibly
after evidence has been destroyed (by test-module actions).
Maybe even have a dedicated VMCrashError exception that tests could
catch in case it's what they're looking for (i.e. error testing)?
There is one. see qemu_vm.py
class QemuSegFaultError(virt_vm.VMError):
def __init__(self, crash_message):
virt_vm.VMError.__init__(self, crash_message)
self.crash_message = crash_message
def __str__(self):
return ("Qemu crashed: %s" % self.crash_message)
Just some ideas.
_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel