mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10.git
synced 2026-09-09 00:07:04 +08:00
JIRA: https://redhat.atlassian.net/browse/RHEL-144808 Upstream Status: linux.git commit 030329416232ff9f2e3e4bb065b29e6c9a7d5050 Author: Xiao Liang <shaw.leon@gmail.com> Date: Wed Feb 19 20:50:38 2025 +0800 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> Signed-off-by: Guillaume Nault <gnault@redhat.com>
10 lines
300 B
Python
10 lines
300 B
Python
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
from .consts import KSRC
|
|
from .ksft import *
|
|
from .netns import NetNS, NetNSEnter
|
|
from .nsim import *
|
|
from .utils import *
|
|
from .ynl import NlError, YnlFamily, EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily
|
|
from .ynl import NetshaperFamily, DevlinkFamily
|