diff options
| author | Breno Leitao <leitao@debian.org> | 2025-02-06 03:05:58 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2025-02-10 15:04:18 +0000 |
| commit | 12fd83ca44d8c4b0a78beab8178a1a6754eae1b3 (patch) | |
| tree | d8acfd53895220fe5b23d6ea7c7d718f6147533c /tools/testing/selftests/drivers/net/lib | |
| parent | ec15bc46c63cc21bba4c4071060797a4b51f50de (diff) | |
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>
Diffstat (limited to 'tools/testing/selftests/drivers/net/lib')
| -rw-r--r-- | tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh b/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh index 0c262b123fdd..3c96b022954d 100644 --- a/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh +++ b/tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh @@ -230,3 +230,20 @@ function check_for_dependencies() { exit "${ksft_skip}" fi } + +function check_for_taskset() { + if ! which taskset > /dev/null ; then + echo "SKIP: taskset(1) is not available" >&2 + exit "${ksft_skip}" + fi +} + +# This is necessary if running multiple tests in a row +function pkill_socat() { + PROCESS_NAME="socat UDP-LISTEN:6666,fork ${OUTPUT_FILE}" + # socat runs under timeout(1), kill it if it is still alive + # do not fail if socat doesn't exist anymore + set +e + pkill -f "${PROCESS_NAME}" + set -e +} |
