summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-21 13:14:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-23 14:29:03 +0000
commitc59d5700247008e17d56d369ff0583d14b4f8225 (patch)
tree3259d02aad417bda03738be0a07bd2394f862fe2 /meta/lib/oeqa
parente31be0b0e6ed6855787ebfbacc15bdbf1b9e511c (diff)
downloadpoky-c59d5700247008e17d56d369ff0583d14b4f8225.tar.gz
oeqa/selftest/rust: Simplify the rust testsuite output gathering/processing
The rust testsuite was redirecting command output to a file, which made it hard to debug failure cases since the logs were not available to print to the console. Rework the code so it uses the existing popen logging and hence allows us to improve the error logging situation and make debugging failures easier. (From OE-Core rev: ac82dc43b8151ed34c4ad51e9ab7f4a612990486) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/rust.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 120be6454f..ad14189c6d 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -216,13 +216,16 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
216 cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath 216 cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
217 # Trigger testing. 217 # Trigger testing.
218 cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip 218 cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
219 cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s > summary.txt 2>&1;" % (builddir, testargs, targetsys) 219 cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)
220 runCmd(cmd) 220 retval = runCmd(cmd)
221 end_time = time.time() 221 end_time = time.time()
222 222
223 resultlog = rustlibpath + "/results-log.txt"
224 with open(resultlog, "w") as f:
225 f.write(retval.output)
226
223 ptestsuite = "rust" 227 ptestsuite = "rust"
224 self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = builddir + "/summary.txt") 228 self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile=resultlog)
225 filename = builddir + "/summary.txt" 229 test_results = parse_results(resultlog)
226 test_results = parse_results(filename)
227 for test in test_results: 230 for test in test_results:
228 self.ptest_result(ptestsuite, test, test_results[test]) 231 self.ptest_result(ptestsuite, test, test_results[test])