netconsole: selftest: test for sysdata CPU
authorBreno Leitao <leitao@debian.org>
Thu, 6 Feb 2025 11:05:58 +0000 (03:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Feb 2025 15:04:18 +0000 (15:04 +0000)
commit12fd83ca44d8c4b0a78beab8178a1a6754eae1b3
treed8acfd53895220fe5b23d6ea7c7d718f6147533c
parentec15bc46c63cc21bba4c4071060797a4b51f50de
netconsole: selftest: test for sysdata CPU

Add a new selftest to verify that the netconsole module correctly
handles CPU runtime data in sysdata. The test validates three scenarios:

1. Basic CPU sysdata functionality - verifies that cpu=X is appended to
   messages
2. CPU sysdata with userdata - ensures CPU data works alongside userdata
3. Disabled CPU sysdata - confirms no CPU data is included when disabled

The test uses taskset to control which CPU sends messages and verifies
the reported CPU matches the one used. This helps ensure that netconsole
accurately tracks and reports the originating CPU of messages.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/Makefile
tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh
tools/testing/selftests/drivers/net/netcons_sysdata.sh [new file with mode: 0755]