summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/lib/py/netns.py
AgeCommit message (Collapse)AuthorFilesLines
2025-02-22selftests: net: Add python context manager for netns enteringXiao Liang1-0/+18
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>
2024-04-23selftests: drv-net: construct environment for running tests which require an ↵Jakub Kicinski1-0/+31
endpoint Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20240420025237.3309296-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>