Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, daniel.zahka@gmail.com,
	willemdebruijn.kernel@gmail.com, donald.hunter@gmail.com,
	shuah@kernel.org, linux-kselftest@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 3/6] selftests: drv-net: psp: check the ifindex an associated netns sees
Date: Sat, 12 Sep 2026 13:04:23 -0700	[thread overview]
Message-ID: <20260912200426.121025-4-kuba@kernel.org> (raw)
In-Reply-To: <20260912200426.121025-1-kuba@kernel.org>

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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 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 @@ from lib.py import ip
 
         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")
-- 
2.55.0


  parent reply	other threads:[~2026-09-12 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 20:04 [PATCH net-next 0/6] psp: correct notifications and device info around device assoc Jakub Kicinski
2026-09-12 20:04 ` [PATCH net-next 1/6] selftests: drv-net: psp: fix linter issues Jakub Kicinski
2026-09-12 20:04 ` [PATCH net-next 2/6] psp: don't report the main netdevice's ifindex to associated namespaces Jakub Kicinski
2026-09-12 20:04 ` Jakub Kicinski [this message]
2026-09-12 20:04 ` [PATCH net-next 4/6] psp: notify about a disassociation once it has happened Jakub Kicinski
2026-09-12 20:04 ` [PATCH net-next 5/6] selftests: drv-net: psp: factor out creating a netkit in the test netns Jakub Kicinski
2026-09-12 20:04 ` [PATCH net-next 6/6] selftests: drv-net: psp: check the PSP disassociation notifications Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260912200426.121025-4-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox