Hi Mika On Fri, 11 Feb 2022 at 17:31, Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> 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. Could you try this out ?