public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Bobby Eshleman <bobbyeshleman@gmail.com>
To: David Wei <dw@davidwei.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Joe Damato <joe@dama.to>, Wei Wang <weibunny@meta.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Nikolay Aleksandrov <razor@blackwall.org>
Subject: Re: [PATCH net-next 2/4] selftests/net: Export Netlink class via lib.py
Date: Wed, 11 Feb 2026 08:12:43 -0800	[thread overview]
Message-ID: <aYyqe+R6EHlj7m6+@devvm11784.nha0.facebook.com> (raw)
In-Reply-To: <20260210200419.3555944-3-dw@davidwei.uk>

On Tue, Feb 10, 2026 at 12:04:17PM -0800, David Wei wrote:
> Making rtnl newlink calls requires constants defined in Netlink class in
> pyynl. Export it.
> 
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
>  tools/testing/selftests/drivers/net/lib/py/__init__.py | 4 ++--
>  tools/testing/selftests/net/lib/py/__init__.py         | 4 ++--
>  tools/testing/selftests/net/lib/py/ynl.py              | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/lib/py/__init__.py b/tools/testing/selftests/drivers/net/lib/py/__init__.py
> index 8b75faa9af6d..a18e21069f7a 100644
> --- a/tools/testing/selftests/drivers/net/lib/py/__init__.py
> +++ b/tools/testing/selftests/drivers/net/lib/py/__init__.py
> @@ -19,7 +19,7 @@ try:
>      # Import one by one to avoid pylint false positives
>      from net.lib.py import NetNS, NetNSEnter, NetdevSimDev
>      from net.lib.py import EthtoolFamily, NetdevFamily, NetshaperFamily, \
> -        NlError, RtnlFamily, DevlinkFamily, PSPFamily
> +        NlError, RtnlFamily, DevlinkFamily, PSPFamily, Netlink
>      from net.lib.py import CmdExitFailure
>      from net.lib.py import bkg, cmd, bpftool, bpftrace, defer, ethtool, \
>          fd_read_timeout, ip, rand_port, wait_port_listen, wait_file
> @@ -31,7 +31,7 @@ try:
>  
>      __all__ = ["NetNS", "NetNSEnter", "NetdevSimDev",
>                 "EthtoolFamily", "NetdevFamily", "NetshaperFamily",
> -               "NlError", "RtnlFamily", "DevlinkFamily", "PSPFamily",
> +               "NlError", "RtnlFamily", "DevlinkFamily", "PSPFamily", "Netlink",
>                 "CmdExitFailure",
>                 "bkg", "cmd", "bpftool", "bpftrace", "defer", "ethtool",
>                 "fd_read_timeout", "ip", "rand_port",
> diff --git a/tools/testing/selftests/net/lib/py/__init__.py b/tools/testing/selftests/net/lib/py/__init__.py
> index f528b67639de..fec518c2a0dc 100644
> --- a/tools/testing/selftests/net/lib/py/__init__.py
> +++ b/tools/testing/selftests/net/lib/py/__init__.py
> @@ -15,7 +15,7 @@ from .nsim import NetdevSim, NetdevSimDev
>  from .utils import CmdExitFailure, fd_read_timeout, cmd, bkg, defer, \
>      bpftool, ip, ethtool, bpftrace, rand_port, wait_port_listen, wait_file, tool
>  from .ynl import NlError, YnlFamily, EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily
> -from .ynl import NetshaperFamily, DevlinkFamily, PSPFamily
> +from .ynl import NetshaperFamily, DevlinkFamily, PSPFamily, Netlink
>  
>  __all__ = ["KSRC",
>             "KsftFailEx", "KsftSkipEx", "KsftXfailEx", "ksft_pr", "ksft_eq",
> @@ -30,4 +30,4 @@ __all__ = ["KSRC",
>             "NetdevSim", "NetdevSimDev",
>             "NetshaperFamily", "DevlinkFamily", "PSPFamily", "NlError",
>             "YnlFamily", "EthtoolFamily", "NetdevFamily", "RtnlFamily",
> -           "RtnlAddrFamily"]
> +           "RtnlAddrFamily", "Netlink"]
> diff --git a/tools/testing/selftests/net/lib/py/ynl.py b/tools/testing/selftests/net/lib/py/ynl.py
> index 32c223e93b2c..a52b067f7589 100644
> --- a/tools/testing/selftests/net/lib/py/ynl.py
> +++ b/tools/testing/selftests/net/lib/py/ynl.py
> @@ -13,14 +13,14 @@ try:
>          SPEC_PATH = KSFT_DIR / "net/lib/specs"
>  
>          sys.path.append(tools_full_path.as_posix())
> -        from net.lib.ynl.pyynl.lib import YnlFamily, NlError
> +        from net.lib.ynl.pyynl.lib import YnlFamily, NlError, Netlink
>      else:
>          # Running in tree
>          tools_full_path = KSRC / "tools"
>          SPEC_PATH = KSRC / "Documentation/netlink/specs"
>  
>          sys.path.append(tools_full_path.as_posix())
> -        from net.ynl.pyynl.lib import YnlFamily, NlError
> +        from net.ynl.pyynl.lib import YnlFamily, NlError, Netlink
>  except ModuleNotFoundError as e:
>      ksft_pr("Failed importing `ynl` library from kernel sources")
>      ksft_pr(str(e))
> -- 
> 2.47.3
> 

Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>

  reply	other threads:[~2026-02-11 16:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10 20:04 [PATCH net-next 0/4] selftests/net: add netkit container env and test David Wei
2026-02-10 20:04 ` [PATCH net-next 1/4] selftests/net: Add bpf skb forwarding program David Wei
2026-02-10 20:04 ` [PATCH net-next 2/4] selftests/net: Export Netlink class via lib.py David Wei
2026-02-11 16:12   ` Bobby Eshleman [this message]
2026-02-10 20:04 ` [PATCH net-next 3/4] selftests/net: Add env for container based tests David Wei
2026-02-11 17:43   ` Bobby Eshleman
2026-02-10 20:04 ` [PATCH net-next 4/4] selftests/net: Add netkit container ping test David Wei
2026-02-11 17:53   ` Bobby Eshleman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYyqe+R6EHlj7m6+@devvm11784.nha0.facebook.com \
    --to=bobbyeshleman@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=joe@dama.to \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    --cc=weibunny@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox