Re: [PATCH net-next v5 7/7] selftests: drv-net: add require_XYZ() helpers for validating env

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Kicinski wrote:
> Wrap typical checks like whether given command used by the test
> is available in helpers.
> 
> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>

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






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux