[PATCH] HTML report: Handle errors when trying to determine test length

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

 



Some test like operations (like a kernel booting), the status
log does not contain test lenght info. So handle accordingly
and mark on report as 'Unknown'.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tools/html_report.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/client/tools/html_report.py b/client/tools/html_report.py
index 7b17a75..c4e97b2 100755
--- a/client/tools/html_report.py
+++ b/client/tools/html_report.py
@@ -1572,10 +1572,13 @@ def parse_result(dirname, line):
             result['log'] = get_exec_log(dirname, tag)
         if len(stimelist)>0:
             pair = parts[4].split('=')
-            etime = int(pair[1])
-            stime = stimelist.pop()
-            total_exec_time_sec = etime - stime
-            result['exec_time_sec'] = total_exec_time_sec
+            try:
+                etime = int(pair[1])
+                stime = stimelist.pop()
+                total_exec_time_sec = etime - stime
+                result['exec_time_sec'] = total_exec_time_sec
+            except ValueError:
+                result['exec_time_sec'] = "Unknown"
         return result
     return None
 
-- 
1.7.5

--
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