summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/ptest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/ptest.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/ptest.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ptest.py b/meta/lib/oeqa/runtime/cases/ptest.py
index 0800f3c27f..fbaeb84d00 100644
--- a/meta/lib/oeqa/runtime/cases/ptest.py
+++ b/meta/lib/oeqa/runtime/cases/ptest.py
@@ -1,4 +1,6 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
2# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
3# 5#
4 6
@@ -57,7 +59,7 @@ class PtestRunnerTest(OERuntimeTestCase):
57 ptest_dirs = [ '/usr/lib' ] 59 ptest_dirs = [ '/usr/lib' ]
58 if not libdir in ptest_dirs: 60 if not libdir in ptest_dirs:
59 ptest_dirs.append(libdir) 61 ptest_dirs.append(libdir)
60 status, output = self.target.run('ptest-runner -d \"{}\"'.format(' '.join(ptest_dirs)), 0) 62 status, output = self.target.run('ptest-runner -t 450 -d \"{}\"'.format(' '.join(ptest_dirs)), 0)
61 os.makedirs(ptest_log_dir) 63 os.makedirs(ptest_log_dir)
62 with open(ptest_runner_log, 'w') as f: 64 with open(ptest_runner_log, 'w') as f:
63 f.write(output) 65 f.write(output)
@@ -81,17 +83,20 @@ class PtestRunnerTest(OERuntimeTestCase):
81 83
82 extras['ptestresult.sections'] = sections 84 extras['ptestresult.sections'] = sections
83 85
86 zerolength = []
84 trans = str.maketrans("()", "__") 87 trans = str.maketrans("()", "__")
85 for section in results: 88 for section in results:
86 for test in results[section]: 89 for test in results[section]:
87 result = results[section][test] 90 result = results[section][test]
88 testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split()) 91 testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split())
89 extras[testname] = {'status': result} 92 extras[testname] = {'status': result}
93 if not results[section]:
94 zerolength.append(section)
90 95
91 failed_tests = {} 96 failed_tests = {}
92 97
93 for section in sections: 98 for section in sections:
94 if 'exitcode' in sections[section].keys(): 99 if 'exitcode' in sections[section].keys() or 'timeout' in sections[section].keys():
95 failed_tests[section] = sections[section]["log"] 100 failed_tests[section] = sections[section]["log"]
96 101
97 for section in results: 102 for section in results:
@@ -105,7 +110,10 @@ class PtestRunnerTest(OERuntimeTestCase):
105 failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output 110 failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output
106 111
107 if failed_tests: 112 if failed_tests:
108 failmsg = failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests) 113 failmsg = failmsg + "\nFailed ptests:\n%s\n" % pprint.pformat(failed_tests)
114
115 if zerolength:
116 failmsg = failmsg + "\nptests which had no test results:\n%s" % pprint.pformat(zerolength)
109 117
110 if failmsg: 118 if failmsg:
111 self.logger.warning("There were failing ptests.") 119 self.logger.warning("There were failing ptests.")