[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250417013301.39228-4-jdamato@fastly.com>
Date: Thu, 17 Apr 2025 01:32:41 +0000
From: Joe Damato <jdamato@...tly.com>
To: netdev@...r.kernel.org
Cc: kuba@...nel.org,
Joe Damato <jdamato@...tly.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Shuah Khan <shuah@...nel.org>,
Xiao Liang <shaw.leon@...il.com>,
Willem de Bruijn <willemb@...gle.com>,
linux-kselftest@...r.kernel.org (open list:KERNEL SELFTEST FRAMEWORK),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next v2 3/4] selftests: net: Allow custom net ns paths
Extend NetNSEnter to allow custom paths in order to support, for
example, /proc/self/ns/net.
Signed-off-by: Joe Damato <jdamato@...tly.com>
---
tools/testing/selftests/net/lib/py/netns.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/lib/py/netns.py b/tools/testing/selftests/net/lib/py/netns.py
index 8e9317044eef..8d5c26317cb0 100644
--- a/tools/testing/selftests/net/lib/py/netns.py
+++ b/tools/testing/selftests/net/lib/py/netns.py
@@ -35,8 +35,8 @@ class NetNS:
class NetNSEnter:
- def __init__(self, ns_name):
- self.ns_path = f"/run/netns/{ns_name}"
+ def __init__(self, ns_name, ns_path="/run/netns/"):
+ self.ns_path = f"{ns_path}{ns_name}"
def __enter__(self):
self.saved = open("/proc/thread-self/ns/net")
--
2.43.0
Powered by blists - more mailing lists