On Sat, Nov 07, 2026 at 06:44:28PM +0000, Omar Ramadan wrote:
> drivers/net/amt.c | 2062 +++++++++++++++++++++++++++++++++++++++++++++
This puts 2062 lines of tests into amt.c, which grows to about 8.6k
lines, roughly a quarter of them test code.
Please move the suite to its own file and use
VISIBLE_IF_KUNIT / EXPORT_SYMBOL_IF_KUNIT for the internals it needs,
if cannot be avoided.
As built today it also breaks the link. With AMT=y and KUNIT=m,
AMT_KUNIT_TEST is m, and the built-in amt.o references symbols that
exist only in kunit.ko:
ld: amt.c: undefined reference to `kunit_binary_assert_format'
ld: amt.c: undefined reference to `__kunit_activate_static_stub'
ld: amt.c: undefined reference to `kunit_kmalloc_array'
The Kconfig entry comes from one of your dependency series, but this
patch adds most of the code that trips it. Make the option bool, or
for example make it depend on KUNIT=y || AMT=m.
With KUNIT_ALL_TESTS=m, as some distributions build, the fake provider
and the suite ship inside the production amt.ko and run at modprobe.
They change module-global state there: the provider list and the
refused counter.
Patch 3 also puts KUNIT_STATIC_STUB_REDIRECT into four production
helpers. Since amt_ofl_op_overran() is one of them, I think the
timing logic it implements is never exercised by these tests.
Regards,
Antonio