Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
From: shuah <shuah@kernel.org>
To: Brendan Higgins <brendanhiggins@google.com>
Cc: SeongJae Park <sj38.park@gmail.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	kunit-dev@googlegroups.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	shuah <shuah@kernel.org>
Subject: Re: [PATCH] kunit: Fix '--build_dir' option
Date: Mon, 7 Oct 2019 17:05:48 -0600
Message-ID: <3b98db74-1b74-1797-c73d-ef7ee375d997@kernel.org> (raw)
In-Reply-To: <CAFd5g47GXbVk4AbRgKb5voG+DLyEEM+KEb+Fgw3u1qjRY2ZhmQ@mail.gmail.com>

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



      reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 12:05 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 message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b98db74-1b74-1797-c73d-ef7ee375d997@kernel.org \
    --to=shuah@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sj38.park@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git