]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/ptest: Avoid traceback for tests with no section
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Jan 2019 11:54:01 +0000 (11:54 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Feb 2019 22:25:04 +0000 (22:25 +0000)
Some tests end up without a section, avoid tracebacks trying to use
None as a string in that case.

(From OE-Core rev: 86fb5d898a29761f120c2eaa538a32cf2e078487)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/lib/oeqa/runtime/cases/ptest.py

index 0972a583eeb21fe2888e3a268e6a9304ac197c56..7d8849308d70b1611517bf8e85a75b362805f509 100644 (file)
@@ -99,7 +99,7 @@ class PtestRunnerTest(OERuntimeTestCase):
         resmap = {'pass': 'PASSED', 'skip': 'SKIPPED', 'fail': 'FAILED'}
         for section in parse_result.result_dict:
             for test, result in parse_result.result_dict[section]:
-                testname = "ptestresult." + section + "." + "_".join(test.translate(trans).split())
+                testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split())
                 extras[testname] = {'status': resmap[result]}
 
         failed_tests = {}