[lkml]   [2019]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] kunit: Fix '--build_dir' option
Running kunit with '--build_dir' option gives following error message:

$ ./tools/testing/kunit/ run --build_dir ../linux.out.kunit/
[00:57:24] Building KUnit Kernel ...
[00:57:29] Starting KUnit Kernel ...
Traceback (most recent call last):
File "./tools/testing/kunit/", line 136, in <module>
File "./tools/testing/kunit/", line 129, in main
result = run_tests(linux, request)
File "./tools/testing/kunit/", line 68, in run_tests
test_result = kunit_parser.parse_run_tests(kunit_output)
File "/home/sjpark/linux/tools/testing/kunit/", line
283, in parse_run_tests
test_result =
File "/home/sjpark/linux/tools/testing/kunit/", line
54, in isolate_kunit_output
for line in kernel_output:
File "/home/sjpark/linux/tools/testing/kunit/", line
145, in run_kernel
process = self._ops.linux_bin(args, timeout, build_dir)
File "/home/sjpark/linux/tools/testing/kunit/", line
69, in linux_bin
File "/usr/lib/python3.5/", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: './linux'

This error occurs because the '--build_dir' option value is not passed
to the 'run_kernel()' function. Consequently, the function assumes
the kernel image that built for the tests, which is under the
'--build_dir' directory, is in kernel source directory and finally raises
the 'FileNotFoundError'.

This commit fixes the problem by properly passing the '--build_dir'
option value to the 'run_kernel()'.

Signed-off-by: SeongJae Park <>
tools/testing/kunit/ | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/testing/kunit/ b/tools/testing/kunit/
index 8d33980..e016430 100755
--- a/tools/testing/kunit/
+++ b/tools/testing/kunit/
@@ -62,9 +62,11 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree,
'Tests not Parsed.')
if request.raw_output:
- linux.run_kernel(timeout=request.timeout))
+ linux.run_kernel(timeout=request.timeout,
+ build_dir=request.build_dir))
- kunit_output = linux.run_kernel(timeout=request.timeout)
+ kunit_output = linux.run_kernel(timeout=request.timeout,
+ build_dir=request.build_dir)
test_result = kunit_parser.parse_run_tests(kunit_output)
test_end = time.time()

 \ /
  Last update: 2019-09-06 18:13    [W:0.045 / U:4.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site