public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH v4] ltp-networking/tcp_cmds/finger: fix finger bad user and host test
Date: Tue, 13 Jan 2015 11:24:47 +0100	[thread overview]
Message-ID: <20150113102446.GA8612@rei.suse.de> (raw)
In-Reply-To: <1412835916-5039-1-git-send-email-liuhangbin@gmail.com>

Hi!
> Finger always return 0 with bad user and host test. And it also return
> different error message on different distros. So let's only check stderr
> message and decide whether the test pass or fail.

Okay, so the test passes if anything was written into stderr. Sounds
good to me.

> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  testcases/network/tcp_cmds/finger/finger01 | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/testcases/network/tcp_cmds/finger/finger01 b/testcases/network/tcp_cmds/finger/finger01
> index 203d746..e01c1ad 100755
> --- a/testcases/network/tcp_cmds/finger/finger01
> +++ b/testcases/network/tcp_cmds/finger/finger01
> @@ -112,14 +112,13 @@ do_test2()
>      BADHOST="xxxx"
>  
>      tst_resm TINFO "finger -badflag default "
> -    finger -x 2>&1 1>/dev/null && end_testcase "finger -x should fail"
> +    finger -x &>/dev/null && end_testcase "finger -x should fail"
>  
>      tst_resm TINFO "finger -bad user "
> -    finger $BADUSER 2>&1 1>/dev/null || end_testcase "finger $BADUSER"
> -    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
> +    [ "$(finger $BADUSER 2>&1 1>/dev/null)" ] || end_testcase "finger $BADUSER"
> +    [ "$(finger @$BADHOST 2>&1 1>/dev/null)" ] || \
> +        end_testcase "finger @$BADHOST"
> +    [ "finger $BADUSER@$BADHOST 2>&1 1>/dev/null" ] || \

Missing $(), otherwise this will be always true because we just pass a
string to the [].

>          end_testcase "finger $BADUSER@$BADHOST"
>      fi

And this fi does belong to the deleted if.

Alexey can you please fix the minor issues and push the patch?

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

           reply	other threads:[~2015-01-13 10:25 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1412835916-5039-1-git-send-email-liuhangbin@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150113102446.GA8612@rei.suse.de \
    --to=chrubis@suse.cz \
    --cc=liuhangbin@gmail.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox