Jakub Kicinski wrote:
> Wrap typical checks like whether given command used by the test
> is available in helpers.
> 
> Signed-off-by: Jakub Kicinski <[email protected]>

>  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
> 



Reply via email to