[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <662529e994190_1e22622942a@willemb.c.googlers.com.notmuch>
Date: Sun, 21 Apr 2024 10:59:53 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
shuah@...nel.org,
petrm@...dia.com,
linux-kselftest@...r.kernel.org,
willemdebruijn.kernel@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next v5 7/7] selftests: drv-net: add require_XYZ()
helpers for validating env
Jakub Kicinski wrote:
> Wrap typical checks like whether given command used by the test
> is available in helpers.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> def test_v4(cfg) -> None:
> + cfg.require_v4()
> +
Probably every platform has ping. But since it is not a built-int and
this patch adds cfg.require_cmd, maybe add it for ping if respinning.
> cmd(f"ping -c 1 -W0.5 {cfg.remote_v4}")
> cmd(f"ping -c 1 -W0.5 {cfg.v4}", host=cfg.remote)
>
>
> def test_v6(cfg) -> None:
> + cfg.require_v6()
> +
> cmd(f"ping -c 1 -W0.5 {cfg.remote_v6}")
> cmd(f"ping -c 1 -W0.5 {cfg.v6}", host=cfg.remote)
>
>
> def test_tcp(cfg) -> None:
> + cfg.require_cmd("socat", remote=True)
> +
> port = rand_port()
> listen_cmd = f"socat -{cfg.addr_ipver} -t 2 -u TCP-LISTEN:{port},reuseport STDOUT"
>
> --
> 2.44.0
>
Powered by blists - more mailing lists