All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: Ricardo Ribalda <ribalda@chromium.org>,
	kunit-dev@googlegroups.com, kasan-dev@googlegroups.com,
	linux-kselftest@vger.kernel.org,
	Brendan Higgins <brendanhiggins@google.com>
Subject: Re: [PATCH v5 3/6] thunderbolt: test: use NULL macros
Date: Mon, 14 Feb 2022 08:24:28 +0200	[thread overview]
Message-ID: <Ygn1nPpPsM/DDqr1@lahna> (raw)
In-Reply-To: <CAGS_qxp3OHFwK__wCHBGr9cMsLR=gfD2rhjejXcmFNJ276_ciw@mail.gmail.com>

Hi,

On Fri, Feb 11, 2022 at 02:54:37PM -0800, Daniel Latypov wrote:
> On Fri, Feb 11, 2022 at 8:33 AM Ricardo Ribalda <ribalda@chromium.org> wrote:
> >
> > Hi Mika
> >
> > On Fri, 11 Feb 2022 at 17:31, Mika Westerberg
> > <mika.westerberg@linux.intel.com> wrote:
> > >
> > > On Fri, Feb 11, 2022 at 06:26:56PM +0200, Mika Westerberg wrote:
> > > > > To test it I had enabled:
> > > > > PCI, USB4 and USB4_KUNIT_TEST
> > > > >
> > > > > and then run it with
> > > > >
> > > > > ./tools/testing/kunit/kunit.py run --jobs=$(nproc) --arch=x86_64
> > > > >
> > > > > Unfortunately, kunit was not able to run the tests
> > > > >
> > > > > This hack did the trick:
> > > > >
> > > > >
> > > > >  int tb_test_init(void)
> > > > >  {
> > > > > -       return __kunit_test_suites_init(tb_test_suites);
> > > > > +       //return __kunit_test_suites_init(tb_test_suites);
> > > > > +       return 0;
> > > > >  }
> > > > >
> > > > >  void tb_test_exit(void)
> > > > >  {
> > > > > -       return __kunit_test_suites_exit(tb_test_suites);
> > > > > +       //return __kunit_test_suites_exit(tb_test_suites);
> > > > >  }
> > > > > +
> > > > > +kunit_test_suites(&tb_test_suite);
> > > > >
> > > > > I looked into why we do this and I found:
> > > > >
> > > > > thunderbolt: Allow KUnit tests to be built also when CONFIG_USB4=m
> > > > >
> > > > >
> > > > > I am a bit confused. The patch talks about build coverage, but even
> > > > > with that patch reverted if
> > > > > USB4_KUNIT_TEST=m
> > > > > then test.c is built.
> > > > >
> > > > > Shouldn't we simply revert that patch?
> > > >
> > > > Nah, either build it into the kernel or load the driver manually:
> > > >
> > > >   # modprobe thunderbolt
> > >
> > > Forgot to explain why this does not run the tests (I think):
> > >
> > >  ./tools/testing/kunit/kunit.py run --jobs=$(nproc) --arch=x86_64
> > >
> > > The driver depends on PCI and I don't think that's enabled on UML at
> > > least. I typically run it inside QEMU.
> 
> You can get it working on UML now.
> If you apply the patch upthread for the test to use kunit_test_suites(), then
> 
> $ cat usb4_kunitconfig
> CONFIG_PCI=y
> CONFIG_VIRTIO_UML=y
> CONFIG_UML_PCI_OVER_VIRTIO=y
> 
> CONFIG_KUNIT=y
> CONFIG_USB4=y
> CONFIG_USB4_KUNIT_TEST=y
> 
> $ ./tools/testing/kunit/kunit.py run --kunitconfig=usb4_kunitconfig
> ...
> [14:48:55] [PASSED] tb_test_property_copy
> [14:48:55] =================== [PASSED] thunderbolt ===================
> [14:48:55] ============================================================
> [14:48:55] Testing complete. Passed: 37, Failed: 0, Crashed: 0,
> Skipped: 0, Errors: 0

That's great!

> Mika, should I propose a patch that updates the test and adds a
> drivers/thunderbolt/.kunitconfig with the above contents?
> 
> Then it could be invoked as
> $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/thunderbolt

Yes please :)

  reply	other threads:[~2022-02-14  6:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11  9:41 [PATCH v5 1/6] kunit: Introduce _NULL and _NOT_NULL macros Ricardo Ribalda
2022-02-11  9:41 ` [PATCH v5 2/6] kunit: use NULL macros Ricardo Ribalda
2022-02-11  9:41 ` [PATCH v5 3/6] thunderbolt: test: " Ricardo Ribalda
2022-02-11 10:08   ` Mika Westerberg
2022-02-11 15:49     ` Ricardo Ribalda
2022-02-11 16:26       ` Mika Westerberg
2022-02-11 16:31         ` Mika Westerberg
2022-02-11 16:33           ` Ricardo Ribalda
2022-02-11 22:54             ` Daniel Latypov
2022-02-14  6:24               ` Mika Westerberg [this message]
2022-02-14 18:43                 ` Daniel Latypov
2022-02-11  9:41 ` [PATCH v5 4/6] kasan: test: Use " Ricardo Ribalda
2022-02-11  9:41 ` [PATCH v5 5/6] mctp: " Ricardo Ribalda
2022-02-11  9:41 ` [PATCH v5 6/6] apparmor: " Ricardo Ribalda

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=Ygn1nPpPsM/DDqr1@lahna \
    --to=mika.westerberg@linux.intel.com \
    --cc=brendanhiggins@google.com \
    --cc=dlatypov@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ribalda@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.