From: Ondrej Lichtner <olichtne(a)redhat.com>
The result summary now ends with a line that reports the total time
lnst-ctl was running tests.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/NetTestResultSerializer.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lnst/Controller/NetTestResultSerializer.py
b/lnst/Controller/NetTestResultSerializer.py
index c007945..622ba04 100644
--- a/lnst/Controller/NetTestResultSerializer.py
+++ b/lnst/Controller/NetTestResultSerializer.py
@@ -12,6 +12,7 @@ jpirko(a)redhat.com (Jiri Pirko)
"""
import logging
+import datetime
from xml.dom.minidom import getDOMImplementation
from lnst.Common.NetTestCommand import str_command
from lnst.Common.Colours import decorate_string, decorate_with_preset
@@ -52,6 +53,7 @@ def get_node_val(node):
class NetTestResultSerializer:
def __init__(self):
self._results = []
+ self._start_time = datetime.datetime.now()
def add_recipe(self, name, match_num):
recipe_result = {"name": name,
@@ -123,6 +125,15 @@ class NetTestResultSerializer:
self._print_pairs(output_pairs)
+ current_time = datetime.datetime.now()
+ dif_time = current_time - self._start_time
+ days = dif_time.days
+ hours = dif_time.seconds/3600
+ minutes = dif_time.seconds/60 - hours*60
+ seconds = dif_time.seconds - minutes*60
+ logging.info("Total test time: %d days, %d hours, %d minutes, "\
+ "%d seconds" % (days, hours, minutes, seconds))
+
def _format_command(self, command, cmd_res, output_pairs, m_id_max):
if cmd_res["passed"]:
res = "PASS"
--
1.9.3
Show replies by date
Fri, Nov 07, 2014 at 02:00:25PM CET, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
The result summary now ends with a line that reports the total time
lnst-ctl was running tests.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
applied, thanks!