summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuba Pawlak <kuba.pawlak@canonical.com>2026-09-04 16:03:34 +0200
committerJakub Kicinski <kuba@kernel.org>2026-09-09 13:49:05 -0700
commit5bb36cd12006500fe6b96c17c2fbe870ae89eb96 (patch)
tree884b0c376318b605817c3d5f034c253b0cf5079b
parent1c9c07d0ad69deaec73ca755ba5f3815fa493bf8 (diff)
downloadlinux-next-5bb36cd12006500fe6b96c17c2fbe870ae89eb96.tar.gz
linux-next-5bb36cd12006500fe6b96c17c2fbe870ae89eb96.zip
selftests: net: Skip so_incoming_cpu on single-CPU systems
The test requires at least two CPUs to exercise the distribution of connections between per-CPU listeners. It currently enforces this prerequisite with an assertion, causing all test cases to fail on single-vCPU systems even though no kernel functionality was tested. Report the unsupported environment as a skip instead. Check the prerequisite before setting up the network namespace so skipped tests do not make unnecessary system changes. Link: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/2023546 Signed-off-by: Kuba Pawlak <kuba.pawlak@canonical.com> Link: https://patch.msgid.link/20260904140334.562593-1-kuba.pawlak@canonical.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--tools/testing/selftests/net/so_incoming_cpu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/selftests/net/so_incoming_cpu.c b/tools/testing/selftests/net/so_incoming_cpu.c
index 4740701f1a9a..1b73442386ae 100644
--- a/tools/testing/selftests/net/so_incoming_cpu.c
+++ b/tools/testing/selftests/net/so_incoming_cpu.c
@@ -81,10 +81,11 @@ static int nr_client_per_server, nr_server, nr_client;
FIXTURE_SETUP(so_incoming_cpu)
{
- setup_netns(_metadata);
-
nr_server = get_nprocs();
- ASSERT_LE(2, nr_server);
+ if (nr_server < 2)
+ SKIP(return, "requires at least two CPUs");
+
+ setup_netns(_metadata);
if (NR_CLIENT_PER_SERVER_DEFAULT * nr_server < NR_PORT)
nr_client_per_server = NR_CLIENT_PER_SERVER_DEFAULT;