mbox series

[0/6] Fix nits in the kunit

Message ID 1575242724-4937-1-git-send-email-sj38.park@gmail.com (mailing list archive)
Headers show
Series Fix nits in the kunit | expand

Message

SeongJae Park Dec. 1, 2019, 11:25 p.m. UTC
From: SeongJae Park <sjpark@amazon.de>

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

SeongJae Park (6):
  docs/kunit/start: Use in-tree 'kunit_defconfig'
  docs/kunit/start: Skip wrapper run command
  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'

 Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
 tools/testing/kunit/kunit.py            | 10 ++++++----
 tools/testing/kunit/kunit_kernel.py     |  6 +++---
 3 files changed, 14 insertions(+), 21 deletions(-)

Comments

Brendan Higgins Dec. 3, 2019, 7 a.m. UTC | #1
On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> This patchset contains trivial fixes for the kunit documentations and the
> wrapper python scripts.
> 
> SeongJae Park (6):
>   docs/kunit/start: Use in-tree 'kunit_defconfig'
>   docs/kunit/start: Skip wrapper run command
>   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'
> 
>  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
>  tools/testing/kunit/kunit.py            | 10 ++++++----
>  tools/testing/kunit/kunit_kernel.py     |  6 +++---
>  3 files changed, 14 insertions(+), 21 deletions(-)

I applied your patchset to torvalds/master, ran the command:

tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit

and got the error:

Traceback (most recent call last):
  File "tools/testing/kunit/kunit.py", line 140, in <module>
    main(sys.argv[1:])
  File "tools/testing/kunit/kunit.py", line 123, in main
    create_default_kunitconfig()
  File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
    kunit_kernel.KUNITCONFIG_PATH)
  File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'

It seems that it expects the build_dir to already exist; however, I
don't think this is clear from the error message. Would you mind
addressing that here?

Cheers!
SeongJae Park Dec. 3, 2019, 7:10 a.m. UTC | #2
On Tue, Dec 3, 2019 at 8:00 AM Brendan Higgins
<brendanhiggins@google.com> wrote:
>
> On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> > From: SeongJae Park <sjpark@amazon.de>
> >
> > This patchset contains trivial fixes for the kunit documentations and the
> > wrapper python scripts.
> >
> > SeongJae Park (6):
> >   docs/kunit/start: Use in-tree 'kunit_defconfig'
> >   docs/kunit/start: Skip wrapper run command
> >   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'
> >
> >  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
> >  tools/testing/kunit/kunit.py            | 10 ++++++----
> >  tools/testing/kunit/kunit_kernel.py     |  6 +++---
> >  3 files changed, 14 insertions(+), 21 deletions(-)
>
> I applied your patchset to torvalds/master, ran the command:
>
> tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit
>
> and got the error:
>
> Traceback (most recent call last):
>   File "tools/testing/kunit/kunit.py", line 140, in <module>
>     main(sys.argv[1:])
>   File "tools/testing/kunit/kunit.py", line 123, in main
>     create_default_kunitconfig()
>   File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
>     kunit_kernel.KUNITCONFIG_PATH)
>   File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
>     with open(dst, 'wb') as fdst:
> FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'
>
> It seems that it expects the build_dir to already exist; however, I
> don't think this is clear from the error message. Would you mind
> addressing that here?

Thank you for sharing this.  I will take a look!


Thanks,
SeongJae Park
>
> Cheers!
SeongJae Park Dec. 3, 2019, 8:25 a.m. UTC | #3
You're right, the error was due to the assumption of the existence of the
build_dir.  The "kunit: Create default config in '--build_dir'" patch made the
bug.  I fixed it in the second version patchset[1].

[1] https://lore.kernel.org/linux-doc/1575361141-6806-1-git-send-email-sj38.park@gmail.com/


Thanks,
SeongJae Park

On Tue, Dec 3, 2019 at 8:10 AM SeongJae Park <sj38.park@gmail.com> wrote:
>
> On Tue, Dec 3, 2019 at 8:00 AM Brendan Higgins
> <brendanhiggins@google.com> wrote:
> >
> > On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> > > From: SeongJae Park <sjpark@amazon.de>
> > >
> > > This patchset contains trivial fixes for the kunit documentations and the
> > > wrapper python scripts.
> > >
> > > SeongJae Park (6):
> > >   docs/kunit/start: Use in-tree 'kunit_defconfig'
> > >   docs/kunit/start: Skip wrapper run command
> > >   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'
> > >
> > >  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
> > >  tools/testing/kunit/kunit.py            | 10 ++++++----
> > >  tools/testing/kunit/kunit_kernel.py     |  6 +++---
> > >  3 files changed, 14 insertions(+), 21 deletions(-)
> >
> > I applied your patchset to torvalds/master, ran the command:
> >
> > tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit
> >
> > and got the error:
> >
> > Traceback (most recent call last):
> >   File "tools/testing/kunit/kunit.py", line 140, in <module>
> >     main(sys.argv[1:])
> >   File "tools/testing/kunit/kunit.py", line 123, in main
> >     create_default_kunitconfig()
> >   File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
> >     kunit_kernel.KUNITCONFIG_PATH)
> >   File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
> >     with open(dst, 'wb') as fdst:
> > FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'
> >
> > It seems that it expects the build_dir to already exist; however, I
> > don't think this is clear from the error message. Would you mind
> > addressing that here?
>
> Thank you for sharing this.  I will take a look!
>
>
> Thanks,
> SeongJae Park
> >
> > Cheers!
Brendan Higgins Dec. 3, 2019, 5:45 p.m. UTC | #4
On Tue, Dec 3, 2019 at 12:26 AM SeongJae Park <sj38.park@gmail.com> wrote:
>
> You're right, the error was due to the assumption of the existence of the
> build_dir.  The "kunit: Create default config in '--build_dir'" patch made the
> bug.  I fixed it in the second version patchset[1].
>
> [1] https://lore.kernel.org/linux-doc/1575361141-6806-1-git-send-email-sj38.park@gmail.com/

After trying your new patches, I am still getting the
"FileNotFoundError" when the given build_dir has not been created.

> Thanks,
> SeongJae Park
>
> On Tue, Dec 3, 2019 at 8:10 AM SeongJae Park <sj38.park@gmail.com> wrote:
> >
> > On Tue, Dec 3, 2019 at 8:00 AM Brendan Higgins
> > <brendanhiggins@google.com> wrote:
> > >
> > > On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> > > > From: SeongJae Park <sjpark@amazon.de>
> > > >
> > > > This patchset contains trivial fixes for the kunit documentations and the
> > > > wrapper python scripts.
> > > >
> > > > SeongJae Park (6):
> > > >   docs/kunit/start: Use in-tree 'kunit_defconfig'
> > > >   docs/kunit/start: Skip wrapper run command
> > > >   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'
> > > >
> > > >  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
> > > >  tools/testing/kunit/kunit.py            | 10 ++++++----
> > > >  tools/testing/kunit/kunit_kernel.py     |  6 +++---
> > > >  3 files changed, 14 insertions(+), 21 deletions(-)
> > >
> > > I applied your patchset to torvalds/master, ran the command:
> > >
> > > tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit
> > >
> > > and got the error:
> > >
> > > Traceback (most recent call last):
> > >   File "tools/testing/kunit/kunit.py", line 140, in <module>
> > >     main(sys.argv[1:])
> > >   File "tools/testing/kunit/kunit.py", line 123, in main
> > >     create_default_kunitconfig()
> > >   File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
> > >     kunit_kernel.KUNITCONFIG_PATH)
> > >   File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
> > >     with open(dst, 'wb') as fdst:
> > > FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'
> > >
> > > It seems that it expects the build_dir to already exist; however, I
> > > don't think this is clear from the error message. Would you mind
> > > addressing that here?
> >
> > Thank you for sharing this.  I will take a look!
> >
> >
> > Thanks,
> > SeongJae Park
> > >
> > > Cheers!
SeongJae Park Dec. 3, 2019, 6:10 p.m. UTC | #5
On Tue, Dec 3, 2019 at 6:45 PM Brendan Higgins
<brendanhiggins@google.com> wrote:
>
> On Tue, Dec 3, 2019 at 12:26 AM SeongJae Park <sj38.park@gmail.com> wrote:
> >
> > You're right, the error was due to the assumption of the existence of the
> > build_dir.  The "kunit: Create default config in '--build_dir'" patch made the
> > bug.  I fixed it in the second version patchset[1].
> >
> > [1] https://lore.kernel.org/linux-doc/1575361141-6806-1-git-send-email-sj38.park@gmail.com/
>
> After trying your new patches, I am still getting the
> "FileNotFoundError" when the given build_dir has not been created.

Sorry, apparently my mistake...  Sent v3 fixing it:
https://lore.kernel.org/linux-kselftest/1575396508-21480-1-git-send-email-sj38.park@gmail.com/T/#t


Thanks,
SeongJae Park


>
> > Thanks,
> > SeongJae Park
> >
> > On Tue, Dec 3, 2019 at 8:10 AM SeongJae Park <sj38.park@gmail.com> wrote:
> > >
> > > On Tue, Dec 3, 2019 at 8:00 AM Brendan Higgins
> > > <brendanhiggins@google.com> wrote:
> > > >
> > > > On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> > > > > From: SeongJae Park <sjpark@amazon.de>
> > > > >
> > > > > This patchset contains trivial fixes for the kunit documentations and the
> > > > > wrapper python scripts.
> > > > >
> > > > > SeongJae Park (6):
> > > > >   docs/kunit/start: Use in-tree 'kunit_defconfig'
> > > > >   docs/kunit/start: Skip wrapper run command
> > > > >   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'
> > > > >
> > > > >  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
> > > > >  tools/testing/kunit/kunit.py            | 10 ++++++----
> > > > >  tools/testing/kunit/kunit_kernel.py     |  6 +++---
> > > > >  3 files changed, 14 insertions(+), 21 deletions(-)
> > > >
> > > > I applied your patchset to torvalds/master, ran the command:
> > > >
> > > > tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit
> > > >
> > > > and got the error:
> > > >
> > > > Traceback (most recent call last):
> > > >   File "tools/testing/kunit/kunit.py", line 140, in <module>
> > > >     main(sys.argv[1:])
> > > >   File "tools/testing/kunit/kunit.py", line 123, in main
> > > >     create_default_kunitconfig()
> > > >   File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
> > > >     kunit_kernel.KUNITCONFIG_PATH)
> > > >   File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
> > > >     with open(dst, 'wb') as fdst:
> > > > FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'
> > > >
> > > > It seems that it expects the build_dir to already exist; however, I
> > > > don't think this is clear from the error message. Would you mind
> > > > addressing that here?
> > >
> > > Thank you for sharing this.  I will take a look!
> > >
> > >
> > > Thanks,
> > > SeongJae Park
> > > >
> > > > Cheers!
Brendan Higgins Dec. 3, 2019, 10:35 p.m. UTC | #6
On Tue, Dec 3, 2019 at 10:11 AM SeongJae Park <sj38.park@gmail.com> wrote:
>
> On Tue, Dec 3, 2019 at 6:45 PM Brendan Higgins
> <brendanhiggins@google.com> wrote:
> >
> > On Tue, Dec 3, 2019 at 12:26 AM SeongJae Park <sj38.park@gmail.com> wrote:
> > >
> > > You're right, the error was due to the assumption of the existence of the
> > > build_dir.  The "kunit: Create default config in '--build_dir'" patch made the
> > > bug.  I fixed it in the second version patchset[1].
> > >
> > > [1] https://lore.kernel.org/linux-doc/1575361141-6806-1-git-send-email-sj38.park@gmail.com/
> >
> > After trying your new patches, I am still getting the
> > "FileNotFoundError" when the given build_dir has not been created.
>
> Sorry, apparently my mistake...  Sent v3 fixing it:
> https://lore.kernel.org/linux-kselftest/1575396508-21480-1-git-send-email-sj38.park@gmail.com/T/#t

Awesome, looks like that works now!

Thanks for taking care of this!

> Thanks,
> SeongJae Park
>
>
> >
> > > Thanks,
> > > SeongJae Park
> > >
> > > On Tue, Dec 3, 2019 at 8:10 AM SeongJae Park <sj38.park@gmail.com> wrote:
> > > >
> > > > On Tue, Dec 3, 2019 at 8:00 AM Brendan Higgins
> > > > <brendanhiggins@google.com> wrote:
> > > > >
> > > > > On Mon, Dec 02, 2019 at 08:25:18AM +0900, SeongJae Park wrote:
> > > > > > From: SeongJae Park <sjpark@amazon.de>
> > > > > >
> > > > > > This patchset contains trivial fixes for the kunit documentations and the
> > > > > > wrapper python scripts.
> > > > > >
> > > > > > SeongJae Park (6):
> > > > > >   docs/kunit/start: Use in-tree 'kunit_defconfig'
> > > > > >   docs/kunit/start: Skip wrapper run command
> > > > > >   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'
> > > > > >
> > > > > >  Documentation/dev-tools/kunit/start.rst | 19 +++++--------------
> > > > > >  tools/testing/kunit/kunit.py            | 10 ++++++----
> > > > > >  tools/testing/kunit/kunit_kernel.py     |  6 +++---
> > > > > >  3 files changed, 14 insertions(+), 21 deletions(-)
> > > > >
> > > > > I applied your patchset to torvalds/master, ran the command:
> > > > >
> > > > > tools/testing/kunit/kunit.py run --timeout=60 --jobs=8 --defconfig --build_dir=.kunit
> > > > >
> > > > > and got the error:
> > > > >
> > > > > Traceback (most recent call last):
> > > > >   File "tools/testing/kunit/kunit.py", line 140, in <module>
> > > > >     main(sys.argv[1:])
> > > > >   File "tools/testing/kunit/kunit.py", line 123, in main
> > > > >     create_default_kunitconfig()
> > > > >   File "tools/testing/kunit/kunit.py", line 36, in create_default_kunitconfig
> > > > >     kunit_kernel.KUNITCONFIG_PATH)
> > > > >   File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
> > > > >     with open(dst, 'wb') as fdst:
> > > > > FileNotFoundError: [Errno 2] No such file or directory: '.kunit/.kunitconfig'
> > > > >
> > > > > It seems that it expects the build_dir to already exist; however, I
> > > > > don't think this is clear from the error message. Would you mind
> > > > > addressing that here?
> > > >
> > > > Thank you for sharing this.  I will take a look!
> > > >
> > > >
> > > > Thanks,
> > > > SeongJae Park
> > > > >
> > > > > Cheers!