* [PATCH] kunit: Fix '--build_dir' option @ 2019-09-06 12:05 SeongJae Park 2019-09-06 15:51 ` shuah 0 siblings, 1 reply; 9+ messages in thread From: SeongJae Park @ 2019-09-06 12:05 UTC (permalink / raw) To: shuah, brendanhiggins Cc: linux-kselftest, kunit-dev, linux-kernel, SeongJae Park kunit fails to run with '--build_dir' option because the option is not properly sent to kernel running procedure. This commit fixes the problem. Signed-off-by: SeongJae Park <sj38.park@gmail.com> --- tools/testing/kunit/kunit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index 8d33980..e016430 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -62,9 +62,11 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree, 'Tests not Parsed.') if request.raw_output: kunit_parser.raw_output( - linux.run_kernel(timeout=request.timeout)) + linux.run_kernel(timeout=request.timeout, + build_dir=request.build_dir)) else: - 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() -- 2.7.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-06 12:05 [PATCH] kunit: Fix '--build_dir' option SeongJae Park @ 2019-09-06 15:51 ` shuah 2019-09-06 16:11 ` SeongJae Park 0 siblings, 1 reply; 9+ messages in thread From: shuah @ 2019-09-06 15:51 UTC (permalink / raw) To: SeongJae Park, brendanhiggins Cc: linux-kselftest, kunit-dev, linux-kernel, shuah On 9/6/19 6:05 AM, SeongJae Park wrote: > kunit fails to run with '--build_dir' option because the option is not > properly sent to kernel running procedure. This commit fixes the > problem. Can you please include the failure you are seeing in the commit log thanks, -- Shuah ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-06 15:51 ` shuah @ 2019-09-06 16:11 ` SeongJae Park 2019-09-06 16:11 ` SeongJae Park 0 siblings, 1 reply; 9+ messages in thread From: SeongJae Park @ 2019-09-06 16:11 UTC (permalink / raw) To: shuah; +Cc: brendanhiggins, linux-kselftest, kunit-dev, LKML On Fri, Sep 6, 2019 at 5:51 PM shuah <shuah@kernel.org> wrote: > > On 9/6/19 6:05 AM, SeongJae Park wrote: > > kunit fails to run with '--build_dir' option because the option is not > > properly sent to kernel running procedure. This commit fixes the > > problem. > > Can you please include the failure you are seeing in the commit log Yes, I will. Thanks, SeongJae Park > > thanks, > -- Shuah > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] kunit: Fix '--build_dir' option 2019-09-06 16:11 ` SeongJae Park @ 2019-09-06 16:11 ` SeongJae Park 2019-09-07 1:16 ` Brendan Higgins 0 siblings, 1 reply; 9+ messages in thread From: SeongJae Park @ 2019-09-06 16:11 UTC (permalink / raw) To: shuah, brendanhiggins Cc: linux-kselftest, kunit-dev, linux-kernel, SeongJae Park Running kunit with '--build_dir' option gives following error message: ``` $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> main(sys.argv[1:]) File "./tools/testing/kunit/kunit.py", line 129, in main result = run_tests(linux, request) File "./tools/testing/kunit/kunit.py", line 68, in run_tests test_result = kunit_parser.parse_run_tests(kunit_output) File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line 283, in parse_run_tests test_result = parse_test_result(list(isolate_kunit_output(kernel_output))) File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line 54, in isolate_kunit_output for line in kernel_output: File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line 145, in run_kernel process = self._ops.linux_bin(args, timeout, build_dir) File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line 69, in linux_bin stderr=subprocess.PIPE) File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> --- tools/testing/kunit/kunit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index 8d33980..e016430 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -62,9 +62,11 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree, 'Tests not Parsed.') if request.raw_output: kunit_parser.raw_output( - linux.run_kernel(timeout=request.timeout)) + linux.run_kernel(timeout=request.timeout, + build_dir=request.build_dir)) else: - 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() -- 2.7.4 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-06 16:11 ` SeongJae Park @ 2019-09-07 1:16 ` Brendan Higgins 2019-09-07 2:33 ` shuah 0 siblings, 1 reply; 9+ messages in thread From: Brendan Higgins @ 2019-09-07 1:16 UTC (permalink / raw) To: SeongJae Park Cc: shuah, open list:KERNEL SELFTEST FRAMEWORK, kunit-dev, Linux Kernel Mailing List On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park <sj38.park@gmail.com> wrote: > > Running kunit with '--build_dir' option gives following error message: > > ``` > $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> > main(sys.argv[1:]) > File "./tools/testing/kunit/kunit.py", line 129, in main > result = run_tests(linux, request) > File "./tools/testing/kunit/kunit.py", line 68, in run_tests > test_result = kunit_parser.parse_run_tests(kunit_output) > File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > 283, in parse_run_tests > test_result = > parse_test_result(list(isolate_kunit_output(kernel_output))) > File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > 54, in isolate_kunit_output > for line in kernel_output: > File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > 145, in run_kernel > process = self._ops.linux_bin(args, timeout, build_dir) > File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > 69, in linux_bin > stderr=subprocess.PIPE) > File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ > restore_signals, start_new_session) > File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Tested-by: Brendan Higgins <brendanhiggins@google.com> Thanks! ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-07 1:16 ` Brendan Higgins @ 2019-09-07 2:33 ` shuah 2019-09-07 9:08 ` SeongJae Park 2019-10-07 22:03 ` Brendan Higgins 0 siblings, 2 replies; 9+ messages in thread From: shuah @ 2019-09-07 2:33 UTC (permalink / raw) To: Brendan Higgins, SeongJae Park Cc: open list:KERNEL SELFTEST FRAMEWORK, kunit-dev, Linux Kernel Mailing List, shuah On 9/6/19 7:16 PM, Brendan Higgins wrote: > On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park <sj38.park@gmail.com> wrote: >> >> Running kunit with '--build_dir' option gives following error message: >> >> ``` >> $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> >> main(sys.argv[1:]) >> File "./tools/testing/kunit/kunit.py", line 129, in main >> result = run_tests(linux, request) >> File "./tools/testing/kunit/kunit.py", line 68, in run_tests >> test_result = kunit_parser.parse_run_tests(kunit_output) >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >> 283, in parse_run_tests >> test_result = >> parse_test_result(list(isolate_kunit_output(kernel_output))) >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >> 54, in isolate_kunit_output >> for line in kernel_output: >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >> 145, in run_kernel >> process = self._ops.linux_bin(args, timeout, build_dir) >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >> 69, in linux_bin >> stderr=subprocess.PIPE) >> File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ >> restore_signals, start_new_session) >> File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> > > Reviewed-by: Brendan Higgins <brendanhiggins@google.com> > Tested-by: Brendan Higgins <brendanhiggins@google.com> > > Thanks! > Thanks Brendan! I will apply the patch for 5.4-rc1. SeongJae Park! In the future, please send tag versions. This should have been [PATCH v2]. thanks, -- Shuah ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-07 2:33 ` shuah @ 2019-09-07 9:08 ` SeongJae Park 2019-10-07 22:03 ` Brendan Higgins 1 sibling, 0 replies; 9+ messages in thread From: SeongJae Park @ 2019-09-07 9:08 UTC (permalink / raw) To: shuah Cc: Brendan Higgins, open list:KERNEL SELFTEST FRAMEWORK, kunit-dev, Linux Kernel Mailing List On Sat, Sep 7, 2019 at 4:33 AM shuah <shuah@kernel.org> wrote: > > On 9/6/19 7:16 PM, Brendan Higgins wrote: > > On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park <sj38.park@gmail.com> wrote: > >> > >> Running kunit with '--build_dir' option gives following error message: > >> > >> ``` > >> $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> > >> main(sys.argv[1:]) > >> File "./tools/testing/kunit/kunit.py", line 129, in main > >> result = run_tests(linux, request) > >> File "./tools/testing/kunit/kunit.py", line 68, in run_tests > >> test_result = kunit_parser.parse_run_tests(kunit_output) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > >> 283, in parse_run_tests > >> test_result = > >> parse_test_result(list(isolate_kunit_output(kernel_output))) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > >> 54, in isolate_kunit_output > >> for line in kernel_output: > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > >> 145, in run_kernel > >> process = self._ops.linux_bin(args, timeout, build_dir) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > >> 69, in linux_bin > >> stderr=subprocess.PIPE) > >> File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ > >> restore_signals, start_new_session) > >> File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> > > > > Reviewed-by: Brendan Higgins <brendanhiggins@google.com> > > Tested-by: Brendan Higgins <brendanhiggins@google.com> > > > > Thanks! > > > > Thanks Brendan! I will apply the patch for 5.4-rc1. Thank you both! > > SeongJae Park! In the future, please send tag versions. This should > have been [PATCH v2]. Yes, I will. Thanks, SeongJae Park > > thanks, > -- Shuah ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-09-07 2:33 ` shuah 2019-09-07 9:08 ` SeongJae Park @ 2019-10-07 22:03 ` Brendan Higgins 2019-10-07 23:05 ` shuah 1 sibling, 1 reply; 9+ messages in thread From: Brendan Higgins @ 2019-10-07 22:03 UTC (permalink / raw) To: shuah Cc: SeongJae Park, open list:KERNEL SELFTEST FRAMEWORK, kunit-dev, Linux Kernel Mailing List On Fri, Sep 6, 2019 at 7:33 PM shuah <shuah@kernel.org> wrote: > > On 9/6/19 7:16 PM, Brendan Higgins wrote: > > On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park <sj38.park@gmail.com> wrote: > >> > >> Running kunit with '--build_dir' option gives following error message: > >> > >> ``` > >> $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> > >> main(sys.argv[1:]) > >> File "./tools/testing/kunit/kunit.py", line 129, in main > >> result = run_tests(linux, request) > >> File "./tools/testing/kunit/kunit.py", line 68, in run_tests > >> test_result = kunit_parser.parse_run_tests(kunit_output) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > >> 283, in parse_run_tests > >> test_result = > >> parse_test_result(list(isolate_kunit_output(kernel_output))) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line > >> 54, in isolate_kunit_output > >> for line in kernel_output: > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > >> 145, in run_kernel > >> process = self._ops.linux_bin(args, timeout, build_dir) > >> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line > >> 69, in linux_bin > >> stderr=subprocess.PIPE) > >> File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ > >> restore_signals, start_new_session) > >> File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> > > > > Reviewed-by: Brendan Higgins <brendanhiggins@google.com> > > Tested-by: Brendan Higgins <brendanhiggins@google.com> > > > > Thanks! > > > > Thanks Brendan! I will apply the patch for 5.4-rc1. Shuah, can you apply this to the kselftest KUnit branch? This should not require a resend. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] kunit: Fix '--build_dir' option 2019-10-07 22:03 ` Brendan Higgins @ 2019-10-07 23:05 ` shuah 0 siblings, 0 replies; 9+ messages in thread From: shuah @ 2019-10-07 23:05 UTC (permalink / raw) To: Brendan Higgins Cc: SeongJae Park, open list:KERNEL SELFTEST FRAMEWORK, kunit-dev, Linux Kernel Mailing List, shuah On 10/7/19 4:03 PM, Brendan Higgins wrote: > On Fri, Sep 6, 2019 at 7:33 PM shuah <shuah@kernel.org> wrote: >> >> On 9/6/19 7:16 PM, Brendan Higgins wrote: >>> On Fri, Sep 6, 2019 at 9:12 AM SeongJae Park <sj38.park@gmail.com> wrote: >>>> >>>> Running kunit with '--build_dir' option gives following error message: >>>> >>>> ``` >>>> $ ./tools/testing/kunit/kunit.py 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/kunit.py", line 136, in <module> >>>> main(sys.argv[1:]) >>>> File "./tools/testing/kunit/kunit.py", line 129, in main >>>> result = run_tests(linux, request) >>>> File "./tools/testing/kunit/kunit.py", line 68, in run_tests >>>> test_result = kunit_parser.parse_run_tests(kunit_output) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >>>> 283, in parse_run_tests >>>> test_result = >>>> parse_test_result(list(isolate_kunit_output(kernel_output))) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_parser.py", line >>>> 54, in isolate_kunit_output >>>> for line in kernel_output: >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >>>> 145, in run_kernel >>>> process = self._ops.linux_bin(args, timeout, build_dir) >>>> File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line >>>> 69, in linux_bin >>>> stderr=subprocess.PIPE) >>>> File "/usr/lib/python3.5/subprocess.py", line 947, in __init__ >>>> restore_signals, start_new_session) >>>> File "/usr/lib/python3.5/subprocess.py", 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 <sj38.park@gmail.com> >>> >>> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> >>> Tested-by: Brendan Higgins <brendanhiggins@google.com> >>> >>> Thanks! >>> >> >> Thanks Brendan! I will apply the patch for 5.4-rc1. > > Shuah, can you apply this to the kselftest KUnit branch? This should > not require a resend. > Done. Applied to https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git test thanks, -- Shuah ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-10-07 23:05 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-09-06 12:05 [PATCH] kunit: Fix '--build_dir' option SeongJae Park 2019-09-06 15:51 ` shuah 2019-09-06 16:11 ` SeongJae Park 2019-09-06 16:11 ` SeongJae Park 2019-09-07 1:16 ` Brendan Higgins 2019-09-07 2:33 ` shuah 2019-09-07 9:08 ` SeongJae Park 2019-10-07 22:03 ` Brendan Higgins 2019-10-07 23:05 ` shuah
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).