[KVM-AUTOTEST][PATCH 2/2] Parse guest autotest results from status file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Recently the autotest runs in the guest would pass but we would fail
to parse the results and indicate a failure.  This is probably due to
the logging change as the stdout output includes the [$date DEBUG]
info which breaks scan_results.py:parse_results().  Rather than trying
to parse the output from the ssh connection parse the status file that
the autotest run in the guest generates.  To do this, move the
guest_results scp operation up and then use the new
parse_results_file() method.

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---
 client/tests/kvm/kvm_tests.py |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py
index 54d2a7a..8fe0fab 100644
--- a/client/tests/kvm/kvm_tests.py
+++ b/client/tests/kvm/kvm_tests.py
@@ -312,8 +312,17 @@ def run_autotest(test, params, env):
 
     session.close()
 
-    # Parse test results
-    result_list = scan_results.parse_results(output)
+    # Copy test results to the local bindir/guest_results
+    logging.info("Copying results back from guest...")
+    guest_results_dir = os.path.join(test.outputdir, "guest_results")
+    if not os.path.exists(guest_results_dir):
+        os.mkdir(guest_results_dir)
+    if not vm.scp_from_remote("autotest/results/default/*", guest_results_dir):
+        logging.error("Could not copy results back from guest")
+
+    # Parse the test results file the guest generated
+    guest_results_file = os.path.join(guest_results_dir, "status")
+    result_list = scan_results.parse_results_file(guest_results_file)
 
     # Report test results and check for FAIL/ERROR status
     logging.info("Results (test, status, duration, info):")
@@ -338,14 +347,6 @@ def run_autotest(test, params, env):
             message_error = "Test '%s' ended with ABORT"
             " (info: '%s')" % (result[0], result[3])
 
-    # Copy test results to the local bindir/guest_results
-    logging.info("Copying results back from guest...")
-    guest_results_dir = os.path.join(test.outputdir, "guest_results")
-    if not os.path.exists(guest_results_dir):
-        os.mkdir(guest_results_dir)
-    if not vm.scp_from_remote("autotest/results/default/*", guest_results_dir):
-        logging.error("Could not copy results back from guest")
-
     # Fail the test if necessary
     if status_fail:
         raise error.TestFail(message_fail)
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux