public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: Hangbin Liu <liuhangbin@gmail.com>,
	LTP List <ltp-list@lists.sourceforge.net>
Cc: vasily.isaenko@oracle.com, Vincent Hsu <vincent.hsu@linaro.org>
Subject: Re: [LTP] [PATCH v2] ltp-networking/tcp_cmds/finger: fix finger bad user and host test
Date: Mon, 29 Sep 2014 20:37:30 +0400	[thread overview]
Message-ID: <54298ACA.1050101@oracle.com> (raw)
In-Reply-To: <1411649975-17339-1-git-send-email-liuhangbin@gmail.com>

Hi!

On 09/25/2014 04:59 PM, Hangbin Liu wrote:
> 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.
>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>   testcases/network/tcp_cmds/finger/finger01 | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/testcases/network/tcp_cmds/finger/finger01 b/testcases/network/tcp_cmds/finger/finger01
> index 203d746..89693ff 100755
> --- a/testcases/network/tcp_cmds/finger/finger01
> +++ b/testcases/network/tcp_cmds/finger/finger01
> @@ -115,13 +115,10 @@ do_test2()
>       finger -x 2>&1 1>/dev/null && end_testcase "finger -x should fail"

I would change redirection here to  > /dev/null 2>&1 as we don't need to 
print stderr.

>   
>       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" ] || \

Checking string constants... not command output, forgot to add '$()'?

Besides, it'd be great to get rid of obsolete 'net_cmdlib.sh' in the test.

Thanks
Alexey


------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-09-29 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 12:59 [LTP] [PATCH v2] ltp-networking/tcp_cmds/finger: fix finger bad user and host test Hangbin Liu
2014-09-29 16:37 ` Alexey Kodanev [this message]
2014-10-09  2:58   ` Hangbin Liu

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=54298ACA.1050101@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=liuhangbin@gmail.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    --cc=vincent.hsu@linaro.org \
    /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