[LTP] [PATCH] test_net.sh: add tst_wait_ipv6_dad()
Alexey Kodanev
alexey.kodanev@oracle.com
Wed Jan 25 14:36:38 CET 2017
On 01/24/2017 06:37 PM, Cyril Hrubis wrote:
> 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 ] ?
Changed to 100ms and applied.
More information about the ltp
mailing list