Skip to content

Commit abd9660

Browse files
committed
kselftest: result variable to be accessed universally
result variable, which stores the command output of selftest, was being run either from test() or run_cmd(). This is based on the component for which it was being run. This patch makes it to be accessed from inside test() irrespective of where it is run, to access the output for post process. Additionally, packages to be installed are also fixed to be in line with latest verions of Ubuntu. Signed-off-by: Narasimhan V <16101053+narasimhan-v@users.noreply.github.com>
1 parent 366d652 commit abd9660

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/kselftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def setUp(self):
7070
if detected_distro.name in ['Ubuntu', 'debian']:
7171
deps.extend(['libpopt0', 'libc6', 'libc6-dev', 'libcap-dev',
7272
'libpopt-dev', 'libcap-ng0', 'libcap-ng-dev',
73-
'libnuma-dev', 'libfuse-dev', 'elfutils', 'libelf1',
73+
'libnuma-dev', 'libfuse-dev', 'elfutils', 'libelf-dev',
7474
'libhugetlbfs-dev'])
7575
elif 'SuSE' in detected_distro.name:
7676
deps.extend(['glibc', 'glibc-devel', 'popt-devel', 'sudo',
@@ -189,8 +189,8 @@ def test(self):
189189
test_comp = self.comp
190190
make_cmd = 'make -C %s %s -C %s run_tests' % (
191191
self.sourcedir, kself_args, test_comp)
192-
result = process.run(make_cmd, shell=True, ignore_status=True)
193-
log_output = result.stdout.decode('utf-8')
192+
self.result = process.run(make_cmd, shell=True, ignore_status=True)
193+
log_output = self.result.stdout.decode('utf-8')
194194
results_path = os.path.join(self.outputdir, 'raw_output')
195195
with open(results_path, 'w') as r_file:
196196
r_file.write(log_output)
@@ -213,8 +213,8 @@ def run_cmd(self, cmd):
213213
Ex: ./ksm_tests -M
214214
"""
215215
try:
216-
result = process.run(cmd, ignore_status=False, sudo=True)
217-
self.log.info(result)
216+
self.result = process.run(cmd, ignore_status=False, sudo=True)
217+
self.log.info(self.result)
218218
except process.CmdError as details:
219219
self.fail("Command %s failed: %s" % (cmd, details))
220220

0 commit comments

Comments
 (0)