Hi!
> Ubuntu use modified finger command. finger an unknown host test will
> return nonzero on Ubuntu 12.04 even if execution success.
> 
> for example:
> in Ubuntu
>     finger @xxx 2>&1 1>/dev/null ; echo $?
> will return
>     finger: unknown host: xxx
>     getaddrinfo: No address associated with hostname
>     1
> in CentOS
>     finger @xxx 2>&1 1>/dev/null ; echo $?
> will return
>     finger: xxx: nodename nor servname provided, or not known
>     0
> 
> Signed-off-by: Vincent Hsu <[email protected]>
> ---
>  testcases/network/tcp_cmds/finger/finger01 |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/network/tcp_cmds/finger/finger01 
> b/testcases/network/tcp_cmds/finger/finger01
> index 6a72c8f..a5206be 100755
> --- a/testcases/network/tcp_cmds/finger/finger01
> +++ b/testcases/network/tcp_cmds/finger/finger01
> @@ -116,8 +116,8 @@ do_test2()
> 
>      tst_resm TINFO "finger -bad user "
>      finger $BADUSER 2>&1 1>/dev/null || end_testcase "finger $BADUSER"
> -    finger @$BADHOST 2>&1 1>/dev/null || end_testcase "finger @$BADHOST"
> -    if ! finger $BADUSER@$BADHOST 2>&1 1>/dev/null; then
> +    finger @$BADHOST 2>&1 1>/dev/null | grep "finger: unknown host" || 
> end_testcase "finger @$BADHOST"
> +    if ! finger $BADUSER@$BADHOST 2>&1 1>/dev/null | grep "finger: unknown 
> host"; then
>          end_testcase "finger $BADUSER@$BADHOST"
>      fi
>  }

The same as the last one, please fix the over 80 chars line.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to