diff options
author | 2025-02-19 20:50:38 +0800 | |
---|---|---|
committer | 2025-02-21 15:28:03 -0800 | |
commit | 030329416232ff9f2e3e4bb065b29e6c9a7d5050 (patch) | |
tree | f3a21746dcb001af24c8148945e662d0775777fc /tools/testing/selftests/net/netns-name.sh | |
parent | rtnetlink: Create link directly in target net namespace (diff) | |
download | wireguard-linux-030329416232ff9f2e3e4bb065b29e6c9a7d5050.tar.xz wireguard-linux-030329416232ff9f2e3e4bb065b29e6c9a7d5050.zip |
selftests: net: Add python context manager for netns entering
Change netns of current thread and switch back on context exit.
For example:
with NetNSEnter("ns1"):
ip("link add dummy0 type dummy")
The command be executed in netns "ns1".
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Link: https://patch.msgid.link/20250219125039.18024-13-shaw.leon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions