Files
Centos-kernel-stream-10/tools/testing/selftests/net/lib/py/__init__.py
T
Guillaume Nault 9535ed6e47 selftests: net: Add python context manager for netns entering
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>
2026-05-13 14:43:10 +02:00

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