Hi!
>  testcases/network/tcp_cmds/tcpdump/tcpdump01 |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01 
> b/testcases/network/tcp_cmds/tcpdump/tcpdump01
> index 4866720..6d99398 100755
> --- a/testcases/network/tcp_cmds/tcpdump/tcpdump01
> +++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01
> @@ -47,8 +47,8 @@ do_setup()
>      tst_setup
> 
>      exists awk grep host hostname ifconfig netstat ping tail tcpdump
> -    RHOST=${RHOST:-`hostname`}
> -    IP=`host ${RHOST} 2>/dev/null | awk '{print $4}'`
> +    LHOST=${LHOST:-`hostname`}
> +    IP=`ping ${LHOST} -c 1 | awk '{print $3}' | head -n1 | cut -f2 -d'(' | 
> cut -f1 -d')'`
>      IFNUMS=`netstat -i|wc -l`
>      IFNUMS=$(( $IFNUMS - 2 ))
>      IFNAME=${IFNAME:-$(netstat -i | awk '{print $1}' | tail -n ${IFNUMS})}

Technically that fixes the problem, but the parsing is too fragile.

What about rewriting the test to use IP="127.0.0.1" and IFNAME="lo"?

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to