[PATCH net-next v6 0/4] selftests: net: fix false failures due to missing features and host interference

Aleksei Oladko posted 4 patches 1 week, 5 days ago
tools/testing/selftests/net/Makefile          |    1 +
.../selftests/net/io_uring_zerocopy_tx.sh     |    9 +
tools/testing/selftests/net/pmtu-test.sh      | 2492 +++++++++++++++++
tools/testing/selftests/net/pmtu.sh           | 2492 +----------------
tools/testing/selftests/net/reuseport_bpf.c   |   11 +
.../testing/selftests/net/reuseport_bpf_cpu.c |   10 +
.../selftests/net/reuseport_bpf_numa.c        |   10 +
.../selftests/net/reuseport_dualstack.c       |   11 +
8 files changed, 2546 insertions(+), 2490 deletions(-)
create mode 100755 tools/testing/selftests/net/pmtu-test.sh
[PATCH net-next v6 0/4] selftests: net: fix false failures due to missing features and host interference
Posted by Aleksei Oladko 1 week, 5 days ago
Hi,

This series addresses several issues in the networking kselftests
that cause false-positive failures depending on the host environment,
kernel configuration, or library versions.

The main focus of these changes is to isolate tests from the host
environment (using namespaces) and to ensure proper fallback or
skipping when dependencies are missing.

Summary of changes:
1. Fixes ovs-dpctl.py to return a non-zero exit code when pyroute2
   is too old. This allows pmtu.sh to correctly fall back to ovs-vsctl
   instead of assuming the configuration was successful.
2-4. Move reuseport test into dedicated network namespaces. This prevents
   failures caused by port conflicts with host processes or interference
   from host firewall rules.
5. Ensures io_uring is enabled via sysctl before running io_uring_zerocopy
   test, preventing failures on systems where kernel.io_uring_disabled
   is set.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>

Changes in v2:
- Fixed a typo by adding the missing backslash in Makefile
- Added a Fixes: tag to the appropriate commit as requested
- Link to v1: https://lore.kernel.org/linux-kselftest/20260120230558.328423-1-aleksey.oladko@virtuozzo.com

Changes in v3:
- renamed pmtu.sh to pmtu-test.sh and used pmtu.sh as the name
  of the wrapper. 
- since the test now runs in a dedicated netns, updates the ovs
  test case to correctly move network interfaces into the target
  namespace.
- Link to v2: https://lore.kernel.org/linux-kselftest/f7t1pj9v8h7.fsf@redhat.com/T/#t

Changes in v4:
- dropped the patch "selftests: net: fib_tests: skip rp_filter test if
  cls_basic is unavailable" since the test environment is expected to
  have all mandatory config options enabled.
- moved isolation logic from in_netns.sh wrapper to unshare() call in
  reuseport_ tests
- Link to v3: https://lore.kernel.org/linux-kselftest/20260306000127.519064-1-aleksey.oladko@virtuozzo.com/T/#t

Changes in v5:
- changed patch prefix/tag from "net" to "net-next"
- Link to v4: https://lore.kernel.org/linux-kselftest/20260309152013.565216-1-aleksey.oladko@virtuozzo.com/T/#t

Changes in v6:
- rebased on "net-next"
- Link to v5: https://lore.kernel.org/linux-kselftest/20260319103123.146112-1-aleksey.oladko@virtuozzo.com/T/#t

Aleksei Oladko (3):
  selftests: net: run reuseport in an isolated netns
  selftests: net: rename pmtu.sh to pmtu-test.sh
  selftests: net: io_uring_zerocopy: enable io_uring for the test

Konstantin Khorenko (1):
  selftests: net: run pmtu.sh in netns to avoid host firewall
    interference

 tools/testing/selftests/net/Makefile          |    1 +
 .../selftests/net/io_uring_zerocopy_tx.sh     |    9 +
 tools/testing/selftests/net/pmtu-test.sh      | 2492 +++++++++++++++++
 tools/testing/selftests/net/pmtu.sh           | 2492 +----------------
 tools/testing/selftests/net/reuseport_bpf.c   |   11 +
 .../testing/selftests/net/reuseport_bpf_cpu.c |   10 +
 .../selftests/net/reuseport_bpf_numa.c        |   10 +
 .../selftests/net/reuseport_dualstack.c       |   11 +
 8 files changed, 2546 insertions(+), 2490 deletions(-)
 create mode 100755 tools/testing/selftests/net/pmtu-test.sh

-- 
2.43.0
Re: [PATCH net-next v6 0/4] selftests: net: fix false failures due to missing features and host interference
Posted by Jakub Kicinski 1 week, 2 days ago
On Sat, 21 Mar 2026 21:59:04 +0000 Aleksei Oladko wrote:
>  tools/testing/selftests/net/pmtu-test.sh      | 2492 +++++++++++++++++
>  tools/testing/selftests/net/pmtu.sh           | 2492 +----------------

I think I asked twice already to fix the test instead of wrapping it in
another helper.
Re: [PATCH net-next v6 0/4] selftests: net: fix false failures due to missing features and host interference
Posted by Stefano Brivio 1 week, 2 days ago
On Mon, 23 Mar 2026 19:58:13 -0700
Jakub Kicinski <kuba@kernel.org> wrote:

> On Sat, 21 Mar 2026 21:59:04 +0000 Aleksei Oladko wrote:
> >  tools/testing/selftests/net/pmtu-test.sh      | 2492 +++++++++++++++++
> >  tools/testing/selftests/net/pmtu.sh           | 2492 +----------------  
> 
> I think I asked twice already to fix the test instead of wrapping it in
> another helper.

Oops, I guess both me and Aleksei understood it as "fix the test _by_
wrapping it in another helper":

  https://lore.kernel.org/all/dd1f8981-b8ad-4a4d-b6c8-3333fb05c93b@virtuozzo.com/

hence the current version.

Aleksei, if you need further tips other than what I was suggesting
(assuming the only way is to run everything in a namespace), this could
be another idea:

  https://git.netfilter.org/nftables/commit/?id=a9cadde4add1

-- 
Stefano