diff options
author | Xiao Liang <shaw.leon@gmail.com> | 2025-02-19 15:50:38 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-22 02:28:03 +0300 |
commit | 030329416232ff9f2e3e4bb065b29e6c9a7d5050 (patch) | |
tree | f3a21746dcb001af24c8148945e662d0775777fc /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 7ca486d08a30936e3b45f535d920848828fefb33 (diff) | |
download | linux-030329416232ff9f2e3e4bb065b29e6c9a7d5050.tar.xz |
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 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions