]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netconsole: selftests: Move netconsole selftests to separate target
authorAndre Carvalho <asantostc@gmail.com>
Tue, 27 Jan 2026 19:39:20 +0000 (19:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Jan 2026 01:30:48 +0000 (17:30 -0800)
This patch moves netconsole selftests from drivers/net to its own target
in drivers/net/netconsole.

This change helps saving some resources from CI since tests in
drivers/net automatically run against real hardware which are not used
by netconsole tests as they rely solely on netdevsim.

lib_netcons.sh is kept under drivers/net/lib since it is also used by
bonding selftests. Finally, drivers/net config remains unchanged as
netpoll_basic.py requires netconsole (and does leverage real HW testing).

Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Andre Carvalho <asantostc@gmail.com>
Link: https://patch.msgid.link/20260127-netcons-selftest-target-v2-1-f509ab65b3bc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 files changed:
MAINTAINERS
tools/testing/selftests/Makefile
tools/testing/selftests/drivers/net/Makefile
tools/testing/selftests/drivers/net/netconsole/Makefile [new file with mode: 0644]
tools/testing/selftests/drivers/net/netconsole/config [new file with mode: 0644]
tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh [moved from tools/testing/selftests/drivers/net/netcons_basic.sh with 98% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_cmdline.sh [moved from tools/testing/selftests/drivers/net/netcons_cmdline.sh with 97% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_fragmented_msg.sh [moved from tools/testing/selftests/drivers/net/netcons_fragmented_msg.sh with 98% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_overflow.sh [moved from tools/testing/selftests/drivers/net/netcons_overflow.sh with 97% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_resume.sh [moved from tools/testing/selftests/drivers/net/netcons_resume.sh with 98% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_sysdata.sh [moved from tools/testing/selftests/drivers/net/netcons_sysdata.sh with 99% similarity]
tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh [moved from tools/testing/selftests/drivers/net/netcons_torture.sh with 98% similarity]

index ff9e204c5f33a05aa76570a5b1ea1d917fc66ab5..0caa8aee58408cac80e37e31841dc9a971f62212 100644 (file)
@@ -18021,7 +18021,7 @@ S:      Maintained
 F:     Documentation/networking/netconsole.rst
 F:     drivers/net/netconsole.c
 F:     tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh
-F:     tools/testing/selftests/drivers/net/netcons\*
+F:     tools/testing/selftests/drivers/net/netconsole/
 
 NETDEVSIM
 M:     Jakub Kicinski <kuba@kernel.org>
index 56e44a98d6a597179a5d7e0e67282c322c22ddda..450f13ba4cca98836bc8a2fe18a2eb43ce14b2d5 100644 (file)
@@ -22,6 +22,7 @@ TARGETS += drivers/ntsync
 TARGETS += drivers/s390x/uvdevice
 TARGETS += drivers/net
 TARGETS += drivers/net/bonding
+TARGETS += drivers/net/netconsole
 TARGETS += drivers/net/team
 TARGETS += drivers/net/virtio_net
 TARGETS += drivers/platform/x86/intel/ifs
index 3eba569b336657461bb30ecac2decf8c91252e22..8154d6d429d3f3914378345ac240aa471c4ed11d 100644 (file)
@@ -15,13 +15,6 @@ TEST_PROGS := \
        hds.py \
        napi_id.py \
        napi_threaded.py \
-       netcons_basic.sh \
-       netcons_cmdline.sh \
-       netcons_fragmented_msg.sh \
-       netcons_overflow.sh \
-       netcons_resume.sh \
-       netcons_sysdata.sh \
-       netcons_torture.sh \
        netpoll_basic.py \
        ping.py \
        psp.py \
diff --git a/tools/testing/selftests/drivers/net/netconsole/Makefile b/tools/testing/selftests/drivers/net/netconsole/Makefile
new file mode 100644 (file)
index 0000000..b56c70b
--- /dev/null
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0
+
+TEST_INCLUDES := \
+       ../../../net/lib.sh \
+       ../lib/sh/lib_netcons.sh \
+# end of TEST_INCLUDES
+
+TEST_PROGS := \
+       netcons_basic.sh \
+       netcons_cmdline.sh \
+       netcons_fragmented_msg.sh \
+       netcons_overflow.sh \
+       netcons_resume.sh \
+       netcons_sysdata.sh \
+       netcons_torture.sh \
+# end of TEST_PROGS
+
+include ../../../lib.mk
+
diff --git a/tools/testing/selftests/drivers/net/netconsole/config b/tools/testing/selftests/drivers/net/netconsole/config
new file mode 100644 (file)
index 0000000..a3f6b0f
--- /dev/null
@@ -0,0 +1,6 @@
+CONFIG_CONFIGFS_FS=y
+CONFIG_IPV6=y
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETCONSOLE_EXTENDED_LOG=y
+CONFIG_NETDEVSIM=m
similarity index 98%
rename from tools/testing/selftests/drivers/net/netcons_basic.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_basic.sh
index 2022f30617380eb7946008d5ad6694c34aaf92bc..59cf10013ecd57900251f708df6e8688006a8544 100755 (executable)
@@ -18,7 +18,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 modprobe netdevsim 2> /dev/null || true
 modprobe netconsole 2> /dev/null || true
similarity index 97%
rename from tools/testing/selftests/drivers/net/netcons_cmdline.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_cmdline.sh
index d1d23dc67f99aa357041b71718550ed94292e57a..96d704b8d9d90897c693cee03e88a6d1ddd62227 100755 (executable)
@@ -12,7 +12,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 check_netconsole_module
 
similarity index 98%
rename from tools/testing/selftests/drivers/net/netcons_fragmented_msg.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_fragmented_msg.sh
index 4a71e01a230c75c14147a9937920fe0b68a0926a..0dc7280c30807aff8ed2f2516bddd42590f63a18 100755 (executable)
@@ -16,7 +16,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 modprobe netdevsim 2> /dev/null || true
 modprobe netconsole 2> /dev/null || true
similarity index 97%
rename from tools/testing/selftests/drivers/net/netcons_overflow.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_overflow.sh
index 06089643b7716fb5cf6d061def9782746c079c3e..a8e43d08c16601e98615c2dc0c03db0440069c01 100755 (executable)
@@ -13,7 +13,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 # This is coming from netconsole code. Check for it in drivers/net/netconsole.c
 MAX_USERDATA_ITEMS=256
 
similarity index 98%
rename from tools/testing/selftests/drivers/net/netcons_resume.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_resume.sh
index fc5e5e3ad3d47740d92f431a6bbae45148c09380..cb59cf436dd0a327260ee684f125864e06bb2433 100755 (executable)
@@ -20,7 +20,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 SAVED_SRCMAC="" # to be populated later
 SAVED_DSTMAC="" # to be populated later
similarity index 99%
rename from tools/testing/selftests/drivers/net/netcons_sysdata.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_sysdata.sh
index baf69031089ebc262cc5a4300c4983dab683fe90..3fb8c4afe3d2cfea3b2bb7be13c549b244954503 100755 (executable)
@@ -18,7 +18,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 # Enable the sysdata cpu_nr feature
 function set_cpu_nr() {
similarity index 98%
rename from tools/testing/selftests/drivers/net/netcons_torture.sh
rename to tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
index 2ce9ee3719d1aa221d1b6f99454c813321c71065..33a44adb6f8f3aa200c556690f0992a5fa9ffcd8 100755 (executable)
@@ -17,7 +17,7 @@ set -euo pipefail
 
 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
 
-source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
+source "${SCRIPTDIR}"/../lib/sh/lib_netcons.sh
 
 # Number of times the main loop run
 ITERATIONS=${1:-150}