[RFC,v1,06/31] arch: um: enabled running kunit from User Mode Linux
diff mbox series

Message ID 20181016235120.138227-7-brendanhiggins@google.com
State Superseded, archived
Headers show
Series
  • kunit: Introducing KUnit, the Linux kernel unit testing framework
Related show

Commit Message

Brendan Higgins Oct. 16, 2018, 11:50 p.m. UTC
Makes minimum number of changes outside of the KUnit directories for
KUnit to build and run using UML.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
---
 Makefile             | 2 +-
 arch/um/Kconfig.rest | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Kieran Bingham Oct. 17, 2018, 3:29 p.m. UTC | #1
Hi Brendan,

I very excitedly jumped on these patches to try them out, as this is
essentially something I was trying to do a few weeks back.

On 17/10/18 00:50, Brendan Higgins wrote:
> Makes minimum number of changes outside of the KUnit directories for
> KUnit to build and run using UML.
> 
> Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> ---
>  Makefile             | 2 +-
>  arch/um/Kconfig.rest | 3 +++

But this file isn't present on v4.19-rc8

It looks like the file is removed at f163977d21a2 ("um: cleanup Kconfig
files")

What version have you currently based these patches on?
Do you expect to keep a branch somewhere that's easy to pull in?

Please add me to the CC list as an interested party on later versions :-)

It might be of interest to the automated testing mailing list too ? (Tim?)

--
regards

Kieran


>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 863f58503beed..c8e659468ed49 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -944,7 +944,7 @@ endif
>  
>  
>  ifeq ($(KBUILD_EXTMOD),)
> -core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
> +core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ kunit/
>  
>  vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
>  		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
> diff --git a/arch/um/Kconfig.rest b/arch/um/Kconfig.rest
> index 08327b9c0cbea..484c4cfcad1ef 100644
> --- a/arch/um/Kconfig.rest
> +++ b/arch/um/Kconfig.rest
> @@ -1,4 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
> +
> +source "kunit/Kconfig"
> +
>  source "init/Kconfig"
>  
>  source "kernel/Kconfig.freezer"
>
Brendan Higgins Oct. 17, 2018, 5:43 p.m. UTC | #2
On Wed, Oct 17, 2018 at 8:29 AM Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Hi Brendan,
>
> I very excitedly jumped on these patches to try them out, as this is
> essentially something I was trying to do a few weeks back.
>
> On 17/10/18 00:50, Brendan Higgins wrote:
> > Makes minimum number of changes outside of the KUnit directories for
> > KUnit to build and run using UML.
> >
> > Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> > ---
> >  Makefile             | 2 +-
> >  arch/um/Kconfig.rest | 3 +++
>
> But this file isn't present on v4.19-rc8
>
> It looks like the file is removed at f163977d21a2 ("um: cleanup Kconfig
> files")

Whoops.

>
> What version have you currently based these patches on?

This patch set is based on 4.18, but I have versions for 4.4, 4.9,
4.14, 4.16, and 4.17.

I will rebase this patch set to 4.19-rc8 and send it out shortly.

> Do you expect to keep a branch somewhere that's easy to pull in?

I have one here: https://kunit-review.googlesource.com/c/linux/+/1030
(you can check it out with git fetch
https://kunit.googlesource.com/linux refs/changes/30/1030/4 && git
checkout FETCH_HEAD)

>
> Please add me to the CC list as an interested party on later versions :-)

Will do.
Bird, Timothy Oct. 17, 2018, 5:52 p.m. UTC | #3
> -----Original Message-----
> From: Kieran Bingham 
> 
> Hi Brendan,
> 
> I very excitedly jumped on these patches to try them out, as this is
> essentially something I was trying to do a few weeks back.
> 
> On 17/10/18 00:50, Brendan Higgins wrote:
> > Makes minimum number of changes outside of the KUnit directories for
> > KUnit to build and run using UML.
> >
> > Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
> > ---
> >  Makefile             | 2 +-
> >  arch/um/Kconfig.rest | 3 +++
> 
> But this file isn't present on v4.19-rc8
> 
> It looks like the file is removed at f163977d21a2 ("um: cleanup Kconfig
> files")
> 
> What version have you currently based these patches on?
> Do you expect to keep a branch somewhere that's easy to pull in?
> 
> Please add me to the CC list as an interested party on later versions :-)
> 
> It might be of interest to the automated testing mailing list too ? (Tim?)

 I think this is interesting to groups doing automated testing of the kernel
(including myself) as another set of tests to run.  Right now I don't see it
as having any special attributes related to automation.  But I could be wrong.
 -- Tim
Brendan Higgins Oct. 17, 2018, 9:09 p.m. UTC | #4
On Wed, Oct 17, 2018 at 10:52 AM <Tim.Bird@sony.com> wrote:
> >
> > It might be of interest to the automated testing mailing list too ? (Tim?)
>
>  I think this is interesting to groups doing automated testing of the kernel
> (including myself) as another set of tests to run.  Right now I don't see it
> as having any special attributes related to automation.  But I could be wrong.

Pardon my ignorance, but by automated testing you mean a CI server
with presubmits, nightlys, and things of the sort?

If that's the case, KUnit could be helpful because of the low resource
cost in running them and the speed at which they run. There are some
other features we would like to add which would help with that goal as
well like test isolation. We actually have a presubmit server
internally for running KUnit tests that can usually respond to patches
with test results within a couple minutes. Would something like that
be interesting?
Bird, Timothy Oct. 17, 2018, 9:18 p.m. UTC | #5
> -----Original Message-----
> From: Brendan Higgins 
> 
> On Wed, Oct 17, 2018 at 10:52 AM <Tim.Bird@sony.com> wrote:
> > >
> > > It might be of interest to the automated testing mailing list too ? (Tim?)
> >
> >  I think this is interesting to groups doing automated testing of the kernel
> > (including myself) as another set of tests to run.  Right now I don't see it
> > as having any special attributes related to automation.  But I could be
> wrong.
> 
> Pardon my ignorance, but by automated testing you mean a CI server
> with presubmits, nightlys, and things of the sort?
Yes.

> 
> If that's the case, KUnit could be helpful because of the low resource
> cost in running them and the speed at which they run.
True.

> There are some
> other features we would like to add which would help with that goal as
> well like test isolation. We actually have a presubmit server
> internally for running KUnit tests that can usually respond to patches
> with test results within a couple minutes. Would something like that
> be interesting?
I think the code and architecture of the software that handles presubmit,
mail-list scanning, notifications, etc. would be of interest.  But KUnit features
themselves (macro definitions, mocking vs. faking, etc.) would not. 
I only say that in the context of CC-ing the automated testing list on the patch set.
Of course the KUnit features are interesting by themselves for testers doing
unit testing.
 -- Tim
Brendan Higgins Oct. 17, 2018, 10:45 p.m. UTC | #6
On Wed, Oct 17, 2018 at 2:18 PM <Tim.Bird@sony.com> wrote:
<snip>
> > There are some
> > other features we would like to add which would help with that goal as
> > well like test isolation. We actually have a presubmit server
> > internally for running KUnit tests that can usually respond to patches
> > with test results within a couple minutes. Would something like that
> > be interesting?
> I think the code and architecture of the software that handles presubmit,
> mail-list scanning, notifications, etc. would be of interest.  But KUnit features
> themselves (macro definitions, mocking vs. faking, etc.) would not.
> I only say that in the context of CC-ing the automated testing list on the patch set.
> Of course the KUnit features are interesting by themselves for testers doing
> unit testing.

Fair enough. Well, we will share what we have in that regard, but that
belongs on a separate thread.

BTW, what mailing list is that? I am also guessing your code isn't in
the kernel repo; where is it?

Patch
diff mbox series

diff --git a/Makefile b/Makefile
index 863f58503beed..c8e659468ed49 100644
--- a/Makefile
+++ b/Makefile
@@ -944,7 +944,7 @@  endif
 
 
 ifeq ($(KBUILD_EXTMOD),)
-core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
+core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ kunit/
 
 vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
diff --git a/arch/um/Kconfig.rest b/arch/um/Kconfig.rest
index 08327b9c0cbea..484c4cfcad1ef 100644
--- a/arch/um/Kconfig.rest
+++ b/arch/um/Kconfig.rest
@@ -1,4 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
+
+source "kunit/Kconfig"
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"