[Fuego] [PATCH 6/9] fuego_check tguid&tables: add support that we can split the output for each testcase
Liu Wenlong
liuwl.fnst at cn.fujitsu.com
Wed Jan 31 07:50:11 UTC 2018
This test has multi-testsets and multi-testcases, it also can use the
generic function that we added before.
We can use those separated logs as the log link, which can help users
to check the log of those failures easily.
Signed-off-by: Liu Wenlong <liuwl.fnst at cn.fujitsu.com>
---
engine/tests/Functional.fuego_check_tables/parser.py | 6 +++++-
engine/tests/Functional.fuego_tguid_check/parser.py | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/engine/tests/Functional.fuego_check_tables/parser.py b/engine/tests/Functional.fuego_check_tables/parser.py
index 6f55b21..3073e39 100755
--- a/engine/tests/Functional.fuego_check_tables/parser.py
+++ b/engine/tests/Functional.fuego_check_tables/parser.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# See common.py for description of command-line arguments
-import os, sys
+import os, sys, collections
sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
import common as plib
@@ -11,6 +11,7 @@ measurements = {}
# FIXTHIS - could do better TAP processing here
regex_string = '^(ok|not ok) (\d+) (.*)$'
matches = plib.parse_log(regex_string)
+measurements = collections.OrderedDict()
print("TRB: matches = %s" % matches)
@@ -21,4 +22,7 @@ if matches:
testcase = parts[1]
measurements[test_set +'.' + testcase] = 'PASS' if m[0] == 'ok' else 'FAIL'
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
sys.exit(plib.process(measurements))
diff --git a/engine/tests/Functional.fuego_tguid_check/parser.py b/engine/tests/Functional.fuego_tguid_check/parser.py
index 6cccac6..145b84c 100755
--- a/engine/tests/Functional.fuego_tguid_check/parser.py
+++ b/engine/tests/Functional.fuego_tguid_check/parser.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# See common.py for description of command-line arguments
-import os, sys
+import os, sys, collections
sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
import common as plib
@@ -10,6 +10,7 @@ results = {}
regex_string = '^(ok|not ok) (\d+) (.*)$'
matches = plib.parse_log(regex_string)
+results = collections.OrderedDict()
for m in matches:
print("DEBUG: in parser.py: m=%s" % str(m))
@@ -18,4 +19,7 @@ for m in matches:
test_id = m[2].replace(" ",".")
results[test_id] = 'PASS' if status == 'ok' else 'FAIL'
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, results)
+
sys.exit(plib.process(results))
--
2.7.4
More information about the Fuego
mailing list