linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/6] Fix nits in the kunit
@ 2019-12-05  9:34 SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig' SeongJae Park
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:34 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

This patchset contains trivial fixes for the kunit documentations and
the wrapper python scripts.

This patchset is based on 'kselftest/test' branch of linux-kselftest[1]
and depends on Heidi's patch[2].  A complete tree is available at my repo:
https://github.com/sjp38/linux/tree/kunit_fix/20191205_v5

Changes from v4
(https://lore.kernel.org/linux-doc/1575490683-13015-1-git-send-email-sj38.park@gmail.com/):
 - Rebased on Heidi Fahim's patch[2]
 - Fix failing kunit_tool_test test
 - Add 'build_dir' option test in 'kunit_tool_test.py'

Changes from v3
(https://lore.kernel.org/linux-kselftest/20191204192141.GA247851@google.com):
 - Fix the 4th patch, "kunit: Place 'test.log' under the 'build_dir'" to
   set default value of 'build_dir' as '' instead of NULL so that kunit
   can run even though '--build_dir' option is not given.

Changes from v2
(https://lore.kernel.org/linux-kselftest/1575361141-6806-1-git-send-email-sj38.park@gmail.com):
 - Make 'build_dir' if not exists (missed from v3 by mistake)

Changes from v1
(https://lore.kernel.org/linux-doc/1575242724-4937-1-git-send-email-sj38.park@gmail.com):
 - Remove "docs/kunit/start: Skip wrapper run command" (A similar
   approach is ongoing)
 - Make 'build_dir' if not exists

SeongJae Park (6):
  docs/kunit/start: Use in-tree 'kunit_defconfig'
  kunit: Remove duplicated defconfig creation
  kunit: Create default config in '--build_dir'
  kunit: Place 'test.log' under the 'build_dir'
  kunit: Rename 'kunitconfig' to '.kunitconfig'
  kunit/kunit_tool_test: Test '--build_dir' option run

 Documentation/dev-tools/kunit/start.rst | 13 +++++--------
 tools/testing/kunit/kunit.py            | 18 +++++++++++-------
 tools/testing/kunit/kunit_kernel.py     | 10 +++++-----
 tools/testing/kunit/kunit_tool_test.py  | 10 +++++++++-
 4 files changed, 30 insertions(+), 21 deletions(-)

-- 

[1] git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
[2] "kunit: testing kunit: Bug fix in test_run_timeout function",
https://lore.kernel.org/linux-kselftest/CAFd5g47a7a8q7by+1ALBtepeegLvfkgwvC3nFd8n8V=hqkV+cg@mail.gmail.com/T/#t)

2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v5 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig'
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
@ 2019-12-05  9:34 ` SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 2/6] kunit: Remove duplicated defconfig creation SeongJae Park
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:34 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

The kunit doc suggests users to get the default `kunitconfig` from an
external git tree.  However, the file is already located under the
`arch/um/configs/` of the kernel tree.  Because the local file is easier
to access and maintain, this commit updates the doc to use it.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
---
 Documentation/dev-tools/kunit/start.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index aeeddfafeea2..78a0aed4931d 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -29,9 +29,8 @@ regular Kernel config, with the specific test targets as well.
 
 .. code-block:: bash
 
-	git clone -b master https://kunit.googlesource.com/kunitconfig $PATH_TO_KUNITCONFIG_REPO
 	cd $PATH_TO_LINUX_REPO
-	ln -s $PATH_TO_KUNIT_CONFIG_REPO/kunitconfig kunitconfig
+	cp arch/um/configs/kunit_defconfig kunitconfig
 
 You may want to add kunitconfig to your local gitignore.
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 2/6] kunit: Remove duplicated defconfig creation
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig' SeongJae Park
@ 2019-12-05  9:34 ` SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 3/6] kunit: Create default config in '--build_dir' SeongJae Park
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:34 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

'--defconfig' option is handled by the 'main() of the 'kunit.py' but
again handled in following 'run_tests()'.  This commit removes this
duplicated handling of the option in the 'run_tests()'.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
---
 tools/testing/kunit/kunit.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index efe06d621983..f8f26951cd1b 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -37,9 +37,6 @@ def create_default_kunitconfig():
 
 def run_tests(linux: kunit_kernel.LinuxSourceTree,
 	      request: KunitRequest) -> KunitResult:
-	if request.defconfig:
-		create_default_kunitconfig()
-
 	config_start = time.time()
 	success = linux.build_reconfig(request.build_dir)
 	config_end = time.time()
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 3/6] kunit: Create default config in '--build_dir'
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig' SeongJae Park
  2019-12-05  9:34 ` [PATCH v5 2/6] kunit: Remove duplicated defconfig creation SeongJae Park
@ 2019-12-05  9:34 ` SeongJae Park
  2019-12-12  1:17   ` Brendan Higgins
  2019-12-05  9:34 ` [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir' SeongJae Park
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:34 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

If both '--build_dir' and '--defconfig' are given, the handling of
'--defconfig' ignores '--build_dir' option.  This commit modifies the
behavior to respect '--build_dir' option.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Suggested-by: Brendan Higgins <brendanhiggins@google.com>
Reported-by: Brendan Higgins <brendanhiggins@google.com>
---
 tools/testing/kunit/kunit.py        | 11 +++++++++--
 tools/testing/kunit/kunit_kernel.py |  4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index f8f26951cd1b..5b222418eacd 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -31,9 +31,9 @@ class KunitStatus(Enum):
 	TEST_FAILURE = auto()
 
 def create_default_kunitconfig():
-	if not os.path.exists(kunit_kernel.KUNITCONFIG_PATH):
+	if not os.path.exists(kunit_kernel.kunitconfig_path):
 		shutil.copyfile('arch/um/configs/kunit_defconfig',
-				kunit_kernel.KUNITCONFIG_PATH)
+				kunit_kernel.kunitconfig_path)
 
 def run_tests(linux: kunit_kernel.LinuxSourceTree,
 	      request: KunitRequest) -> KunitResult:
@@ -114,6 +114,13 @@ def main(argv, linux=None):
 	cli_args = parser.parse_args(argv)
 
 	if cli_args.subcommand == 'run':
+		if cli_args.build_dir:
+			if not os.path.exists(cli_args.build_dir):
+				os.mkdir(cli_args.build_dir)
+			kunit_kernel.kunitconfig_path = os.path.join(
+				cli_args.build_dir,
+				kunit_kernel.kunitconfig_path)
+
 		if cli_args.defconfig:
 			create_default_kunitconfig()
 
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index bf3876835331..c04a12e2f711 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -14,7 +14,7 @@ import os
 import kunit_config
 
 KCONFIG_PATH = '.config'
-KUNITCONFIG_PATH = 'kunitconfig'
+kunitconfig_path = 'kunitconfig'
 
 class ConfigError(Exception):
 	"""Represents an error trying to configure the Linux kernel."""
@@ -82,7 +82,7 @@ class LinuxSourceTree(object):
 
 	def __init__(self):
 		self._kconfig = kunit_config.Kconfig()
-		self._kconfig.read_from_file(KUNITCONFIG_PATH)
+		self._kconfig.read_from_file(kunitconfig_path)
 		self._ops = LinuxSourceTreeOperations()
 
 	def clean(self):
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir'
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
                   ` (2 preceding siblings ...)
  2019-12-05  9:34 ` [PATCH v5 3/6] kunit: Create default config in '--build_dir' SeongJae Park
@ 2019-12-05  9:34 ` SeongJae Park
  2019-12-12  1:24   ` Brendan Higgins
  2019-12-05  9:38 ` [PATCH v5 5/6] kunit: Rename 'kunitconfig' to '.kunitconfig' SeongJae Park
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:34 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

'kunit' writes the 'test.log' under the kernel source directory even
though a 'build_dir' option is given.  As users who use the option might
expect the outputs to be placed under the specified directory, this
commit modifies the logic to write the log file under the 'build_dir'.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/kunit/kunit.py           | 2 +-
 tools/testing/kunit/kunit_kernel.py    | 4 ++--
 tools/testing/kunit/kunit_tool_test.py | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index 5b222418eacd..e4250c4b06fb 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -105,7 +105,7 @@ def main(argv, linux=None):
 	run_parser.add_argument('--build_dir',
 				help='As in the make command, it specifies the build '
 				'directory.',
-				type=str, default=None, metavar='build_dir')
+				type=str, default='', metavar='build_dir')
 
 	run_parser.add_argument('--defconfig',
 				help='Uses a default kunitconfig.',
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index c04a12e2f711..a10c0c787bc1 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -140,10 +140,10 @@ class LinuxSourceTree(object):
 			return False
 		return True
 
-	def run_kernel(self, args=[], timeout=None, build_dir=None):
+	def run_kernel(self, args=[], timeout=None, build_dir=''):
 		args.extend(['mem=256M'])
 		process = self._ops.linux_bin(args, timeout, build_dir)
-		with open('test.log', 'w') as f:
+		with open(os.path.join(build_dir, 'test.log'), 'w') as f:
 			for line in process.stdout:
 				f.write(line.rstrip().decode('ascii') + '\n')
 				yield line.rstrip().decode('ascii')
diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py
index a2a8ea6beae3..22f16e66b3c1 100755
--- a/tools/testing/kunit/kunit_tool_test.py
+++ b/tools/testing/kunit/kunit_tool_test.py
@@ -199,7 +199,7 @@ class KUnitMainTest(unittest.TestCase):
 		timeout = 3453
 		kunit.main(['run', '--timeout', str(timeout)], self.linux_source_mock)
 		assert self.linux_source_mock.build_reconfig.call_count == 1
-		self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=None, timeout=timeout)
+		self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=timeout)
 		self.print_mock.assert_any_call(StrContains('Testing complete.'))
 
 if __name__ == '__main__':
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 5/6] kunit: Rename 'kunitconfig' to '.kunitconfig'
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
                   ` (3 preceding siblings ...)
  2019-12-05  9:34 ` [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir' SeongJae Park
@ 2019-12-05  9:38 ` SeongJae Park
  2019-12-05  9:38 ` [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run SeongJae Park
  2019-12-11 16:33 ` [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
  6 siblings, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:38 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

This commit renames 'kunitconfig' to '.kunitconfig' so that it can be
automatically ignored by git and do not disturb people who want to type
'kernel/' by pressing only the 'k' and then 'tab' key.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
---
 Documentation/dev-tools/kunit/start.rst | 12 +++++-------
 tools/testing/kunit/kunit.py            |  2 +-
 tools/testing/kunit/kunit_kernel.py     |  4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index 78a0aed4931d..faa6fa99f903 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -21,18 +21,16 @@ The wrapper can be run with:
 
    ./tools/testing/kunit/kunit.py run
 
-Creating a kunitconfig
-======================
+Creating a .kunitconfig
+=======================
 The Python script is a thin wrapper around Kbuild as such, it needs to be
-configured with a ``kunitconfig`` file. This file essentially contains the
+configured with a ``.kunitconfig`` file. This file essentially contains the
 regular Kernel config, with the specific test targets as well.
 
 .. code-block:: bash
 
 	cd $PATH_TO_LINUX_REPO
-	cp arch/um/configs/kunit_defconfig kunitconfig
-
-You may want to add kunitconfig to your local gitignore.
+	cp arch/um/configs/kunit_defconfig .kunitconfig
 
 Verifying KUnit Works
 ---------------------
@@ -147,7 +145,7 @@ and the following to ``drivers/misc/Makefile``:
 
 	obj-$(CONFIG_MISC_EXAMPLE_TEST) += example-test.o
 
-Now add it to your ``kunitconfig``:
+Now add it to your ``.kunitconfig``:
 
 .. code-block:: none
 
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index e4250c4b06fb..e59eb9e7f923 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -108,7 +108,7 @@ def main(argv, linux=None):
 				type=str, default='', metavar='build_dir')
 
 	run_parser.add_argument('--defconfig',
-				help='Uses a default kunitconfig.',
+				help='Uses a default .kunitconfig.',
 				action='store_true')
 
 	cli_args = parser.parse_args(argv)
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index a10c0c787bc1..cc5d844ecca1 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -14,7 +14,7 @@ import os
 import kunit_config
 
 KCONFIG_PATH = '.config'
-kunitconfig_path = 'kunitconfig'
+kunitconfig_path = '.kunitconfig'
 
 class ConfigError(Exception):
 	"""Represents an error trying to configure the Linux kernel."""
@@ -111,7 +111,7 @@ class LinuxSourceTree(object):
 		return True
 
 	def build_reconfig(self, build_dir):
-		"""Creates a new .config if it is not a subset of the kunitconfig."""
+		"""Creates a new .config if it is not a subset of the .kunitconfig."""
 		kconfig_path = get_kconfig_path(build_dir)
 		if os.path.exists(kconfig_path):
 			existing_kconfig = kunit_config.Kconfig()
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
                   ` (4 preceding siblings ...)
  2019-12-05  9:38 ` [PATCH v5 5/6] kunit: Rename 'kunitconfig' to '.kunitconfig' SeongJae Park
@ 2019-12-05  9:38 ` SeongJae Park
  2019-12-12  1:31   ` Brendan Higgins
  2019-12-11 16:33 ` [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
  6 siblings, 1 reply; 16+ messages in thread
From: SeongJae Park @ 2019-12-05  9:38 UTC (permalink / raw)
  To: brendanhiggins
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

From: SeongJae Park <sjpark@amazon.de>

This commit adds kunit tool test for the '--build_dir' option.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 tools/testing/kunit/kunit_tool_test.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py
index 22f16e66b3c1..cba97756ac4a 100755
--- a/tools/testing/kunit/kunit_tool_test.py
+++ b/tools/testing/kunit/kunit_tool_test.py
@@ -174,6 +174,7 @@ class KUnitMainTest(unittest.TestCase):
 		kunit.main(['run'], self.linux_source_mock)
 		assert self.linux_source_mock.build_reconfig.call_count == 1
 		assert self.linux_source_mock.run_kernel.call_count == 1
+		self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=300)
 		self.print_mock.assert_any_call(StrContains('Testing complete.'))
 
 	def test_run_passes_args_fail(self):
@@ -202,5 +203,12 @@ class KUnitMainTest(unittest.TestCase):
 		self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='', timeout=timeout)
 		self.print_mock.assert_any_call(StrContains('Testing complete.'))
 
+	def test_run_builddir(self):
+		build_dir = '.kunit'
+		kunit.main(['run', '--build_dir', build_dir], self.linux_source_mock)
+		assert self.linux_source_mock.build_reconfig.call_count == 1
+		self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, timeout=300)
+		self.print_mock.assert_any_call(StrContains('Testing complete.'))
+
 if __name__ == '__main__':
 	unittest.main()
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
                   ` (5 preceding siblings ...)
  2019-12-05  9:38 ` [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run SeongJae Park
@ 2019-12-11 16:33 ` SeongJae Park
  2019-12-11 17:22   ` shuah
  6 siblings, 1 reply; 16+ messages in thread
From: SeongJae Park @ 2019-12-11 16:33 UTC (permalink / raw)
  To: SeongJae Park
  Cc: sj38.park, corbet, kunit-dev, linux-doc, linux-kernel,
	linux-kselftest, shuah, sjpark

May I ask some comments?


Thanks,
SeongJae Park

On Thu, 5 Dec 2019 10:34:34 +0100 SeongJae Park <sjpark@amazon.com> wrote:

> 
> This patchset contains trivial fixes for the kunit documentations and
> the wrapper python scripts.
> 
> This patchset is based on 'kselftest/test' branch of linux-kselftest[1]
> and depends on Heidi's patch[2].  A complete tree is available at my repo:
> https://github.com/sjp38/linux/tree/kunit_fix/20191205_v5
> 
> Changes from v4
> (https://lore.kernel.org/linux-doc/1575490683-13015-1-git-send-email-sj38.park@gmail.com/):
>  - Rebased on Heidi Fahim's patch[2]
>  - Fix failing kunit_tool_test test
>  - Add 'build_dir' option test in 'kunit_tool_test.py'
> 
> Changes from v3
> (https://lore.kernel.org/linux-kselftest/20191204192141.GA247851@google.com):
>  - Fix the 4th patch, "kunit: Place 'test.log' under the 'build_dir'" to
>    set default value of 'build_dir' as '' instead of NULL so that kunit
>    can run even though '--build_dir' option is not given.
> 
> Changes from v2
> (https://lore.kernel.org/linux-kselftest/1575361141-6806-1-git-send-email-sj38.park@gmail.com):
>  - Make 'build_dir' if not exists (missed from v3 by mistake)
> 
> Changes from v1
> (https://lore.kernel.org/linux-doc/1575242724-4937-1-git-send-email-sj38.park@gmail.com):
>  - Remove "docs/kunit/start: Skip wrapper run command" (A similar
>    approach is ongoing)
>  - Make 'build_dir' if not exists
> 
> SeongJae Park (6):
>   docs/kunit/start: Use in-tree 'kunit_defconfig'
>   kunit: Remove duplicated defconfig creation
>   kunit: Create default config in '--build_dir'
>   kunit: Place 'test.log' under the 'build_dir'
>   kunit: Rename 'kunitconfig' to '.kunitconfig'
>   kunit/kunit_tool_test: Test '--build_dir' option run
> 
>  Documentation/dev-tools/kunit/start.rst | 13 +++++--------
>  tools/testing/kunit/kunit.py            | 18 +++++++++++-------
>  tools/testing/kunit/kunit_kernel.py     | 10 +++++-----
>  tools/testing/kunit/kunit_tool_test.py  | 10 +++++++++-
>  4 files changed, 30 insertions(+), 21 deletions(-)
> 
> -- 
> 
> [1] git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
> [2] "kunit: testing kunit: Bug fix in test_run_timeout function",
> https://lore.kernel.org/linux-kselftest/CAFd5g47a7a8q7by+1ALBtepeegLvfkgwvC3nFd8n8V=hqkV+cg@mail.gmail.com/T/#t)
> 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-11 16:33 ` [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
@ 2019-12-11 17:22   ` shuah
  2019-12-11 17:40     ` SeongJae Park
  0 siblings, 1 reply; 16+ messages in thread
From: shuah @ 2019-12-11 17:22 UTC (permalink / raw)
  To: SeongJae Park, SeongJae Park, Brendan Higgins
  Cc: corbet, kunit-dev, linux-doc, linux-kernel, linux-kselftest,
	sjpark, shuah

On 12/11/19 9:33 AM, SeongJae Park wrote:
> May I ask some comments?
> 
> 
> Thanks,
> SeongJae Park
> 

+ Brendan

> On Thu, 5 Dec 2019 10:34:34 +0100 SeongJae Park <sjpark@amazon.com> wrote:
> 
>>
>> This patchset contains trivial fixes for the kunit documentations and
>> the wrapper python scripts.
>>
>> This patchset is based on 'kselftest/test' branch of linux-kselftest[1]
>> and depends on Heidi's patch[2].  A complete tree is available at my repo:
>> https://github.com/sjp38/linux/tree/kunit_fix/20191205_v5
>>
>> Changes from v4
>> (https://lore.kernel.org/linux-doc/1575490683-13015-1-git-send-email-sj38.park@gmail.com/):
>>   - Rebased on Heidi Fahim's patch[2]
>>   - Fix failing kunit_tool_test test
>>   - Add 'build_dir' option test in 'kunit_tool_test.py'
>>

Please include Brendana Higgins on kunit patches.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-11 17:22   ` shuah
@ 2019-12-11 17:40     ` SeongJae Park
  2019-12-11 17:45       ` Brendan Higgins
  0 siblings, 1 reply; 16+ messages in thread
From: SeongJae Park @ 2019-12-11 17:40 UTC (permalink / raw)
  To: shuah
  Cc: SeongJae Park, Brendan Higgins, Jonathan Corbet,
	KUnit Development, linux-doc, LKML,
	open list:KERNEL SELFTEST FRAMEWORK, SeongJae Park

On Wed, Dec 11, 2019 at 6:22 PM shuah <shuah@kernel.org> wrote:
>
> On 12/11/19 9:33 AM, SeongJae Park wrote:
> > May I ask some comments?
> >
> >
> > Thanks,
> > SeongJae Park
> >
>
> + Brendan
>
> > On Thu, 5 Dec 2019 10:34:34 +0100 SeongJae Park <sjpark@amazon.com> wrote:
> >
> >>
> >> This patchset contains trivial fixes for the kunit documentations and
> >> the wrapper python scripts.
> >>
> >> This patchset is based on 'kselftest/test' branch of linux-kselftest[1]
> >> and depends on Heidi's patch[2].  A complete tree is available at my repo:
> >> https://github.com/sjp38/linux/tree/kunit_fix/20191205_v5
> >>
> >> Changes from v4
> >> (https://lore.kernel.org/linux-doc/1575490683-13015-1-git-send-email-sj38.park@gmail.com/):
> >>   - Rebased on Heidi Fahim's patch[2]
> >>   - Fix failing kunit_tool_test test
> >>   - Add 'build_dir' option test in 'kunit_tool_test.py'
> >>
>
> Please include Brendana Higgins on kunit patches.

Not sure how I could forgot adding him.  I will never forget from next time.


Thanks,
SeongJae Park

>
> thanks,
> -- Shuah

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-11 17:40     ` SeongJae Park
@ 2019-12-11 17:45       ` Brendan Higgins
  2019-12-12  2:06         ` Brendan Higgins
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Higgins @ 2019-12-11 17:45 UTC (permalink / raw)
  To: SeongJae Park
  Cc: shuah, SeongJae Park, Jonathan Corbet, KUnit Development,
	linux-doc, LKML, open list:KERNEL SELFTEST FRAMEWORK,
	SeongJae Park

On Wed, Dec 11, 2019 at 9:40 AM SeongJae Park <sj38.park@gmail.com> wrote:
>
> On Wed, Dec 11, 2019 at 6:22 PM shuah <shuah@kernel.org> wrote:
> >
> > On 12/11/19 9:33 AM, SeongJae Park wrote:
> > > May I ask some comments?
> > >
> > >
> > > Thanks,
> > > SeongJae Park
> > >
> >
> > + Brendan
> >
> > > On Thu, 5 Dec 2019 10:34:34 +0100 SeongJae Park <sjpark@amazon.com> wrote:
> > >
> > >>
> > >> This patchset contains trivial fixes for the kunit documentations and
> > >> the wrapper python scripts.
> > >>
> > >> This patchset is based on 'kselftest/test' branch of linux-kselftest[1]
> > >> and depends on Heidi's patch[2].  A complete tree is available at my repo:
> > >> https://github.com/sjp38/linux/tree/kunit_fix/20191205_v5
> > >>
> > >> Changes from v4
> > >> (https://lore.kernel.org/linux-doc/1575490683-13015-1-git-send-email-sj38.park@gmail.com/):
> > >>   - Rebased on Heidi Fahim's patch[2]
> > >>   - Fix failing kunit_tool_test test
> > >>   - Add 'build_dir' option test in 'kunit_tool_test.py'
> > >>
> >
> > Please include Brendana Higgins on kunit patches.
>
> Not sure how I could forgot adding him.  I will never forget from next time.

No worries. I still got the email from the list :-)

I think I reviewed all the patches in this series; I just need to test
them. I will try to have that done later today or tomorrow.

Cheers!

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 3/6] kunit: Create default config in '--build_dir'
  2019-12-05  9:34 ` [PATCH v5 3/6] kunit: Create default config in '--build_dir' SeongJae Park
@ 2019-12-12  1:17   ` Brendan Higgins
  0 siblings, 0 replies; 16+ messages in thread
From: Brendan Higgins @ 2019-12-12  1:17 UTC (permalink / raw)
  To: SeongJae Park
  Cc: SeongJae Park, Jonathan Corbet, KUnit Development,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	open list:KERNEL SELFTEST FRAMEWORK, shuah, SeongJae Park

On Thu, Dec 5, 2019 at 1:35 AM SeongJae Park <sjpark@amazon.com> wrote:
>
> From: SeongJae Park <sjpark@amazon.de>
>
> If both '--build_dir' and '--defconfig' are given, the handling of
> '--defconfig' ignores '--build_dir' option.  This commit modifies the
> behavior to respect '--build_dir' option.
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> Suggested-by: Brendan Higgins <brendanhiggins@google.com>
> Reported-by: Brendan Higgins <brendanhiggins@google.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir'
  2019-12-05  9:34 ` [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir' SeongJae Park
@ 2019-12-12  1:24   ` Brendan Higgins
  0 siblings, 0 replies; 16+ messages in thread
From: Brendan Higgins @ 2019-12-12  1:24 UTC (permalink / raw)
  To: SeongJae Park
  Cc: SeongJae Park, Jonathan Corbet, KUnit Development,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	open list:KERNEL SELFTEST FRAMEWORK, shuah, SeongJae Park

On Thu, Dec 5, 2019 at 1:35 AM SeongJae Park <sjpark@amazon.com> wrote:
>
> From: SeongJae Park <sjpark@amazon.de>
>
> 'kunit' writes the 'test.log' under the kernel source directory even
> though a 'build_dir' option is given.  As users who use the option might
> expect the outputs to be placed under the specified directory, this
> commit modifies the logic to write the log file under the 'build_dir'.
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run
  2019-12-05  9:38 ` [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run SeongJae Park
@ 2019-12-12  1:31   ` Brendan Higgins
  0 siblings, 0 replies; 16+ messages in thread
From: Brendan Higgins @ 2019-12-12  1:31 UTC (permalink / raw)
  To: SeongJae Park
  Cc: SeongJae Park, Jonathan Corbet, KUnit Development,
	open list:DOCUMENTATION, Linux Kernel Mailing List,
	open list:KERNEL SELFTEST FRAMEWORK, shuah, SeongJae Park

On Thu, Dec 5, 2019 at 1:38 AM SeongJae Park <sjpark@amazon.com> wrote:
>
> From: SeongJae Park <sjpark@amazon.de>
>
> This commit adds kunit tool test for the '--build_dir' option.
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-11 17:45       ` Brendan Higgins
@ 2019-12-12  2:06         ` Brendan Higgins
  2019-12-12  2:12           ` SeongJae Park
  0 siblings, 1 reply; 16+ messages in thread
From: Brendan Higgins @ 2019-12-12  2:06 UTC (permalink / raw)
  To: SeongJae Park
  Cc: shuah, SeongJae Park, Jonathan Corbet, KUnit Development,
	linux-doc, LKML, open list:KERNEL SELFTEST FRAMEWORK,
	SeongJae Park

On Wed, Dec 11, 2019 at 9:45 AM Brendan Higgins
<brendanhiggins@google.com> wrote:
>
> On Wed, Dec 11, 2019 at 9:40 AM SeongJae Park <sj38.park@gmail.com> wrote:
> >
> > On Wed, Dec 11, 2019 at 6:22 PM shuah <shuah@kernel.org> wrote:
> > >
> > > On 12/11/19 9:33 AM, SeongJae Park wrote:
> > > > May I ask some comments?

SeongJae,

I reviewed and tested all your patches. Everything looks good to me
with one minor caveat: I tried applying your patches on
kselftest/fixes[1] and got the following error:

error: patch failed: Documentation/dev-tools/kunit/start.rst:21
error: Documentation/dev-tools/kunit/start.rst: patch does not apply
Patch failed at 0005 kunit: Rename 'kunitconfig' to '.kunitconfig'

I think the merge conflict is fairly straightforward, but it would
still probably make Shuah's life easier if you rebased your patches.

Cheers!

P.S. Thanks for the patch adding the test case for test the build_dir
thing. I really appreciate that!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=fixes

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 0/6] Fix nits in the kunit
  2019-12-12  2:06         ` Brendan Higgins
@ 2019-12-12  2:12           ` SeongJae Park
  0 siblings, 0 replies; 16+ messages in thread
From: SeongJae Park @ 2019-12-12  2:12 UTC (permalink / raw)
  To: Brendan Higgins
  Cc: shuah, SeongJae Park, Jonathan Corbet, KUnit Development,
	linux-doc, LKML, open list:KERNEL SELFTEST FRAMEWORK,
	SeongJae Park

On Thu, Dec 12, 2019 at 3:06 AM Brendan Higgins
<brendanhiggins@google.com> wrote:
>
> On Wed, Dec 11, 2019 at 9:45 AM Brendan Higgins
> <brendanhiggins@google.com> wrote:
> >
> > On Wed, Dec 11, 2019 at 9:40 AM SeongJae Park <sj38.park@gmail.com> wrote:
> > >
> > > On Wed, Dec 11, 2019 at 6:22 PM shuah <shuah@kernel.org> wrote:
> > > >
> > > > On 12/11/19 9:33 AM, SeongJae Park wrote:
> > > > > May I ask some comments?
>
> SeongJae,
>
> I reviewed and tested all your patches. Everything looks good to me
> with one minor caveat: I tried applying your patches on
> kselftest/fixes[1] and got the following error:
>
> error: patch failed: Documentation/dev-tools/kunit/start.rst:21
> error: Documentation/dev-tools/kunit/start.rst: patch does not apply
> Patch failed at 0005 kunit: Rename 'kunitconfig' to '.kunitconfig'
>
> I think the merge conflict is fairly straightforward, but it would
> still probably make Shuah's life easier if you rebased your patches.

Appreciate your nice response, I will rebase it and send the next version!


Thanks,
SeongJae Park

>
> Cheers!
>
> P.S. Thanks for the patch adding the test case for test the build_dir
> thing. I really appreciate that!
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=fixes

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-12-12  2:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05  9:34 [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
2019-12-05  9:34 ` [PATCH v5 1/6] docs/kunit/start: Use in-tree 'kunit_defconfig' SeongJae Park
2019-12-05  9:34 ` [PATCH v5 2/6] kunit: Remove duplicated defconfig creation SeongJae Park
2019-12-05  9:34 ` [PATCH v5 3/6] kunit: Create default config in '--build_dir' SeongJae Park
2019-12-12  1:17   ` Brendan Higgins
2019-12-05  9:34 ` [PATCH v5 4/6] kunit: Place 'test.log' under the 'build_dir' SeongJae Park
2019-12-12  1:24   ` Brendan Higgins
2019-12-05  9:38 ` [PATCH v5 5/6] kunit: Rename 'kunitconfig' to '.kunitconfig' SeongJae Park
2019-12-05  9:38 ` [PATCH v5 6/6] kunit/kunit_tool_test: Test '--build_dir' option run SeongJae Park
2019-12-12  1:31   ` Brendan Higgins
2019-12-11 16:33 ` [PATCH v5 0/6] Fix nits in the kunit SeongJae Park
2019-12-11 17:22   ` shuah
2019-12-11 17:40     ` SeongJae Park
2019-12-11 17:45       ` Brendan Higgins
2019-12-12  2:06         ` Brendan Higgins
2019-12-12  2:12           ` SeongJae Park

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).