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 <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20260912200426.121025-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2026-09-12 13:04:23 -07:00
parent cf3302111b
commit 4d5d9f3a19

View File

@ -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")