[LTP] [PATCH v4 1/7] tst_net.sh: enhance tst_add_ipaddr(), add tst_del_ipaddr()

Alexey Kodanev alexey.kodanev@oracle.com
Thu Sep 12 14:12:49 CEST 2019


Hi Petr,
On 03.09.2019 17:16, Petr Vorel wrote:
> These changes are intended for easier handling with IP addresses
> (not have to calculate dad for IPv6 when adding IP address).
> Add -a IP and -s options to tst_add_ipaddr()
> 
> tst_del_ipaddr() (which uses internally tst_add_ipaddr()) is defined
> mainly for better code readability.
...
>  
> -	tst_res_ TINFO "set remote addr $(tst_ipaddr rhost)/$mask"
> -	tst_rhost_run -c "ip addr add $(tst_ipaddr rhost)/$mask dev $iface $dad"
> +	tst_res_ TINFO "set remote addr $addr"

                         ^
                  Should be $action here?

> +	tst_rhost_run $rsafe -c "ip addr $action $addr dev $iface $dad"
> +}
> +
> +# tst_del_ipaddr [ tst_add_ipaddr options ]
> +# Delete IP address
> +tst_del_ipaddr()
> +{
> +	tst_add_ipaddr -d $@
>  }
>  
>  # tst_restore_ipaddr [TYPE] [LINK]
> 



More information about the ltp mailing list