From 4d5d9f3a19682450858ff93ba3beaae65784ee3d Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Sat, 12 Sep 2026 13:04:23 -0700 Subject: [PATCH] selftests: drv-net: psp: check the ifindex an associated netns sees dev-get must not report the ifindex outside of the main netns. The dev-get checks for an associated namespace are already there, add the "no main ifindex" assertion. Reviewed-by: Daniel Zahka Link: https://patch.msgid.link/20260912200426.121025-4-kuba@kernel.org Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/psp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py index 5e87fb50c348..43780efb84ed 100755 --- a/tools/testing/selftests/drivers/net/psp.py +++ b/tools/testing/selftests/drivers/net/psp.py @@ -749,6 +749,10 @@ def _psp_dev_get_check_netkit_psp_assoc(cfg): ksft_not_none(peer_dev, "No PSP device found with by-association flag in guest netns") + # ifindex of the main netdevice means nothing in this namespace + ksft_true('ifindex' not in peer_dev, + "ifindex reported to an associated namespace") + # Verify assoc-list contains the nk_guest device ksft_true('assoc-list' in peer_dev and len(peer_dev['assoc-list']) > 0, "Guest device should have assoc-list with local devices")