Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Brendan Higgins <brendanhiggins@google.com>,
	shuah@kernel.org, davidgow@google.com
Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org, Tim.Bird@sony.com,
	"skh >> Shuah Khan" <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2 1/2] kunit: tool: fix running kunit_tool from outside kernel tree
Date: Mon, 31 Aug 2020 15:41:51 -0600	[thread overview]
Message-ID: <d073fd4d-93e6-4c43-a814-c13719ac2259@linuxfoundation.org> (raw)
In-Reply-To: <20200811212756.3328740-1-brendanhiggins@google.com>

On 8/11/20 3:27 PM, Brendan Higgins wrote:
> Currently kunit_tool does not work correctly when executed from a path
> outside of the kernel tree, so make sure that the current working
> directory is correct and the kunit_dir is properly initialized before
> running.
> 
> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> ---
>   tools/testing/kunit/kunit.py | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
> index 425ef40067e7e..e2caf4e24ecb2 100755
> --- a/tools/testing/kunit/kunit.py
> +++ b/tools/testing/kunit/kunit.py
> @@ -237,9 +237,13 @@ def main(argv, linux=None):
>   
>   	cli_args = parser.parse_args(argv)
>   
> +	if get_kernel_root_path():
> +		os.chdir(get_kernel_root_path())
> +
>   	if cli_args.subcommand == 'run':
>   		if not os.path.exists(cli_args.build_dir):
>   			os.mkdir(cli_args.build_dir)
> +			create_default_kunitconfig()
>   
>   		if not linux:
>   			linux = kunit_kernel.LinuxSourceTree()
> @@ -257,6 +261,7 @@ def main(argv, linux=None):
>   		if cli_args.build_dir:
>   			if not os.path.exists(cli_args.build_dir):
>   				os.mkdir(cli_args.build_dir)
> +				create_default_kunitconfig()
>   
>   		if not linux:
>   			linux = kunit_kernel.LinuxSourceTree()
> @@ -270,10 +275,6 @@ def main(argv, linux=None):
>   		if result.status != KunitStatus.SUCCESS:
>   			sys.exit(1)
>   	elif cli_args.subcommand == 'build':
> -		if cli_args.build_dir:
> -			if not os.path.exists(cli_args.build_dir):
> -				os.mkdir(cli_args.build_dir)
> -
>   		if not linux:
>   			linux = kunit_kernel.LinuxSourceTree()
>   
> @@ -288,10 +289,6 @@ def main(argv, linux=None):
>   		if result.status != KunitStatus.SUCCESS:
>   			sys.exit(1)
>   	elif cli_args.subcommand == 'exec':
> -		if cli_args.build_dir:
> -			if not os.path.exists(cli_args.build_dir):
> -				os.mkdir(cli_args.build_dir)
> -
>   		if not linux:
>   			linux = kunit_kernel.LinuxSourceTree()
>   
> 
> base-commit: 30185b69a2d533c4ba6ca926b8390ce7de495e29
> 


Applied the two patches in this seeries to linux-kselftest kunit-fixes
for the next 5.9-rc fixes

thanks,
-- Shuah

      parent reply	other threads:[~2020-08-31 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 21:27 [PATCH v2 1/2] kunit: tool: fix running kunit_tool from outside kernel tree Brendan Higgins
2020-08-11 21:27 ` [PATCH v2 2/2] kunit: tool: allow generating test results in JSON Brendan Higgins
2020-08-31 21:41 ` Shuah Khan [this message]

Reply instructions:

You may reply publicly 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=d073fd4d-93e6-4c43-a814-c13719ac2259@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=Tim.Bird@sony.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox