Sometimes a userspace crash [1] might happen during
postprocessing steps. Such crashes shouldn't happen,
and we want the test to fail if they did. So introduce
vm.verify_userspace_crash() checks at some core points
of the postprocessing steps.

Of course, due to the fact we already have a quite
complex processing system, I might be overseeing some
potential problems due to interrupting the processing
workflow. The changes look secure to me, but they
would need a good deal of testing to validate them.

With those changes, we'd be catching a lot of these
late postprocess related crashes.

[1] In practical terms, the only VM type that has a useful
crash detection implementation in virt tests as of now
is QEMU.

CC: Qingtang Zhou <[email protected]>
CC: Cevich <[email protected]>
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 virttest/env_process.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virttest/env_process.py b/virttest/env_process.py
index fed3682..19343a4 100644
--- a/virttest/env_process.py
+++ b/virttest/env_process.py
@@ -199,6 +199,10 @@ def postprocess_vm(test, params, env, name):
         except Exception, detail:
             logging.info("Video creation failed for vm %s: %s", vm.name, 
detail)
 
+    # 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:
@@ -268,6 +272,9 @@ def process(test, params, env, image_func, vm_func, 
vm_first=False):
                     finally:
                         if unpause_vm:
                             vm.resume()
+                # During the image operations, the VM userspace might crash,
+                # if it happened, we want to capture it.
+                vm.verify_userspace_crash()
         else:
             for image_name in params.objects("images"):
                 image_params = params.object_params(image_name)
-- 
1.8.1.2

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to