Skip to contentSkip to conversation

ltp: add RDEPENDS on findutils

PATCH New [email protected] 1 participant 2 messages Jul 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ltp: add RDEPENDS on findutils

From: Ross Burton <[email protected]>

With busybox find some of the test script fails, so depend on GNU find.

---
 meta/recipes-extended/ltp/ltp_20230516.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-extended/ltp/ltp_20230516.bb +1 -0
index ddc6523e302..e9407d3148e 100644
@@ -93,6 +93,7 @@ RDEPENDS:${PN} = "\
     e2fsprogs-mke2fs \
     expect \
     file \
+    findutils \
     gawk \
     gdb \
     gzip \
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 oeqa/ltp: rewrote LTP testcase and parser

From: Ross Burton <[email protected]>

The LTP test reporting appears to be a little fragile so I tried to make it more reliable.

Primarily this is done by not passing -p to runltp, which results in machine-readable logfiles instead of human-readable. These are easier to parse and have more context in, so we can also report correctly skipped tests.

---
 meta/lib/oeqa/runtime/cases/ltp.py | 17 +++++---
 meta/lib/oeqa/utils/logparser.py   | 62 +++++++++++++++++++-----------
 2 files changed, 51 insertions(+), 28 deletions(-)
meta/lib/oeqa/runtime/cases/ltp.py +11 -6
index a66d5d13d75..29c26d7d324 100644
@@ -65,29 +65,34 @@ class LtpTest(LtpTestBase):
     ltp_groups += ltp_fs
 
     def runltp(self, ltp_group):
-            cmd = '/opt/ltp/runltp -f %s -p -q -r /opt/ltp -l /opt/ltp/results/%s -I 1 -d /opt/ltp' % (ltp_group, ltp_group)
+            # LTP appends to log files, so ensure we start with a clean log
+            self.target.deleteFiles("/opt/ltp/results/", ltp_group)
+
+            cmd = '/opt/ltp/runltp -f %s -q -r /opt/ltp -l /opt/ltp/results/%s -I 1 -d /opt/ltp' % (ltp_group, ltp_group)
+
             starttime = time.time()
             (status, output) = self.target.run(cmd)
             endtime = time.time()
 
+            # Write the console log to disk for convenience
             with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % ltp_group), 'w') as f:
                 f.write(output)
 
+            # Also put the console log into the test result JSON
             self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output
 
-            # copy nice log from DUT
-            dst = os.path.join(self.ltptest_log_dir, "%s" %  ltp_group )
+            # Copy the machine-readable test results locally so we can parse it
+            dst = os.path.join(self.ltptest_log_dir, ltp_group)
             remote_src = "/opt/ltp/results/%s" % ltp_group 
             (status, output) = self.target.copyFrom(remote_src, dst, True)
-            msg = 'File could not be copied. Output: %s' % output
             if status:
+                msg = 'File could not be copied. Output: %s' % output
                 self.target.logger.warning(msg)
 
             parser = LtpParser()
             results, sections  = parser.parse(dst)
 
-            runtime = int(endtime-starttime)
-            sections['duration'] = runtime
+            sections['duration'] = int(endtime-starttime)
             self.sections[ltp_group] =  sections
 
             failed_tests = {}
meta/lib/oeqa/utils/logparser.py +40 -22

77 lines not on this page · raw message

Signature · 1 line
2.34.1