[LTP] [PATCH] test_net.sh: add tst_wait_ipv6_dad()

Cyril Hrubis chrubis@suse.cz
Tue Jan 24 16:37:33 CET 2017


Hi!
> +tst_wait_ipv6_dad()
> +{
> +	local ret=
> +	local i=
> +	local iface_loc=${1:-$(tst_iface)}
> +	local iface_rmt=${2:-$(tst_iface rhost)}
> +
> +	for i in $(seq 1 5); do
> +		ip a sh $iface_loc | grep -q tentative
> +		ret=$?
> +
> +		tst_rhost_run -c "ip a sh $iface_rmt | grep -q tentative"
> +
> +		[ $ret -ne 0 -a $? -ne 0 ] && return
> +
> +		if [ $i -ne 5 ]; then
> +			tst_resm TINFO "wait for IPv6 DAD completion $i/5 sec"
> +			tst_sleep 1s

My only concern here is that sleeping for 1s is too much and will slow
down things more than it should. How long this operation usually takes?
Can we reduce the sleep to 0.1s here and print the TINFO only
if [ $((i % 10)) -eq 0 ] ?


> +			continue
> +		fi
> +
> +		tst_resm TWARN "Interface has tentative IP address(es)"
> +	done
> +}
> +
>  # tst_netload ADDR [FILE] [TYPE] [OPTS]
>  # Run network load test
>  # ADDR: IP address
> -- 
> 1.7.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list