summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/cases/ltp.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/runtime/cases/ltp.py')
-rw-r--r--meta/lib/oeqa/runtime/cases/ltp.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ltp.py b/meta/lib/oeqa/runtime/cases/ltp.py
index a66d5d13d7..f588a93200 100644
--- a/meta/lib/oeqa/runtime/cases/ltp.py
+++ b/meta/lib/oeqa/runtime/cases/ltp.py
@@ -57,37 +57,47 @@ class LtpTestBase(OERuntimeTestCase):
57 57
58class LtpTest(LtpTestBase): 58class LtpTest(LtpTestBase):
59 59
60 ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors", "commands", "net.ipv6_lib", "input","fs_perms_simple"] 60 ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "commands", "net.ipv6_lib", "input","fs_perms_simple", "cve", "crypto", "ima", "net.nfs", "net_stress.ipsec_icmp", "net.ipv6", "numa", "uevent", "ltp-aiodio.part1", "ltp-aiodio.part2", "ltp-aiodio.part3", "ltp-aiodio.part4"]
61 61
62 ltp_fs = ["fs", "fsx", "fs_bind"] 62 ltp_fs = ["fs", "fs_bind"]
63 # skip kernel cpuhotplug 63 # skip kernel cpuhotplug
64 ltp_kernel = ["power_management_tests", "hyperthreading ", "kernel_misc", "hugetlb"] 64 ltp_kernel = ["power_management_tests", "hyperthreading ", "kernel_misc", "hugetlb"]
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, timeout=1200)
71 endtime = time.time() 75 endtime = time.time()
72 76
77 # status of 1 is 'just' tests failing. 255 likely was a command output timeout
78 if status and status != 1:
79 msg = 'Command %s returned exit code %s' % (cmd, status)
80 self.target.logger.warning(msg)
81
82 # 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: 83 with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % ltp_group), 'w') as f:
74 f.write(output) 84 f.write(output)
75 85
86 # Also put the console log into the test result JSON
76 self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output 87 self.extras['ltpresult.rawlogs']['log'] = self.extras['ltpresult.rawlogs']['log'] + output
77 88
78 # copy nice log from DUT 89 # Copy the machine-readable test results locally so we can parse it
79 dst = os.path.join(self.ltptest_log_dir, "%s" % ltp_group ) 90 dst = os.path.join(self.ltptest_log_dir, ltp_group)
80 remote_src = "/opt/ltp/results/%s" % ltp_group 91 remote_src = "/opt/ltp/results/%s" % ltp_group
81 (status, output) = self.target.copyFrom(remote_src, dst, True) 92 (status, output) = self.target.copyFrom(remote_src, dst, True)
82 msg = 'File could not be copied. Output: %s' % output
83 if status: 93 if status:
94 msg = 'File could not be copied. Output: %s' % output
84 self.target.logger.warning(msg) 95 self.target.logger.warning(msg)
85 96
86 parser = LtpParser() 97 parser = LtpParser()
87 results, sections = parser.parse(dst) 98 results, sections = parser.parse(dst)
88 99
89 runtime = int(endtime-starttime) 100 sections['duration'] = int(endtime-starttime)
90 sections['duration'] = runtime
91 self.sections[ltp_group] = sections 101 self.sections[ltp_group] = sections
92 102
93 failed_tests = {} 103 failed_tests = {}