diff options
Diffstat (limited to 'meta/lib/oeqa/runtime')
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/ltp.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ltp.py b/meta/lib/oeqa/runtime/cases/ltp.py index a66d5d13d7..29c26d7d32 100644 --- a/meta/lib/oeqa/runtime/cases/ltp.py +++ b/meta/lib/oeqa/runtime/cases/ltp.py | |||
| @@ -65,29 +65,34 @@ class LtpTest(LtpTestBase): | |||
| 65 | ltp_groups += ltp_fs | 65 | ltp_groups += ltp_fs |
| 66 | 66 | ||
| 67 | def runltp(self, ltp_group): | 67 | def runltp(self, ltp_group): |
| 68 | 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) | 68 | # LTP appends to log files, so ensure we start with a clean log |
| 69 | self.target.deleteFiles("/opt/ltp/results/", ltp_group) | ||
| 70 | |||
| 71 | cmd = '/opt/ltp/runltp -f %s -q -r /opt/ltp -l /opt/ltp/results/%s -I 1 -d /opt/ltp' % (ltp_group, ltp_group) | ||
| 72 | |||
| 69 | starttime = time.time() | 73 | starttime = time.time() |
| 70 | (status, output) = self.target.run(cmd) | 74 | (status, output) = self.target.run(cmd) |
| 71 | endtime = time.time() | 75 | endtime = time.time() |
| 72 | 76 | ||
| 77 | # Write the console log to disk for convenience | ||
| 73 | with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % ltp_group), 'w') as f: | 78 | with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % ltp_group), 'w') as f: |
| 74 | f.write(output) | 79 | f.write(output) |
| 75 | 80 | ||
| 81 | # Also put the console log into the test result JSON | ||
| 76 | self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output | 82 | self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output |
| 77 | 83 | ||
| 78 | # copy nice log from DUT | 84 | # Copy the machine-readable test results locally so we can parse it |
| 79 | dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group ) | 85 | dst = os.path.join(self.ltptest_log_dir, ltp_group) |
| 80 | remote_src = "/opt/ltp/results/%s" % ltp_group | 86 | remote_src = "/opt/ltp/results/%s" % ltp_group |
| 81 | (status, output) = self.target.copyFrom(remote_src, dst, True) | 87 | (status, output) = self.target.copyFrom(remote_src, dst, True) |
| 82 | msg = 'File could not be copied. Output: %s' % output | ||
| 83 | if status: | 88 | if status: |
| 89 | msg = 'File could not be copied. Output: %s' % output | ||
| 84 | self.target.logger.warning(msg) | 90 | self.target.logger.warning(msg) |
| 85 | 91 | ||
| 86 | parser = LtpParser() | 92 | parser = LtpParser() |
| 87 | results, sections = parser.parse(dst) | 93 | results, sections = parser.parse(dst) |
| 88 | 94 | ||
| 89 | runtime = int(endtime-starttime) | 95 | sections['duration'] = int(endtime-starttime) |
| 90 | sections['duration'] = runtime | ||
| 91 | self.sections[ltp_group] = sections | 96 | self.sections[ltp_group] = sections |
| 92 | 97 | ||
| 93 | failed_tests = {} | 98 | failed_tests = {} |
