From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: Linux Test Project <ltp-list@lists.sourceforge.net>,
Mike Frysinger <vapier@gentoo.org>
Subject: Re: [LTP] fix mail_tests for systems without mail installed
Date: Fri, 28 Aug 2009 11:39:25 +0530 [thread overview]
Message-ID: <1251439768.9081.11.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <alpine.LRH.2.00.0908271416250.22490@vixen.sonytel.be>
On Thu, 2009-08-27 at 14:19 +0200, Geert Uytterhoeven wrote:
> On Thu, 13 Aug 2009, Mike Frysinger wrote:
> > On Wednesday 12 August 2009 17:14:09 Paul Larson wrote:
> > > +`which mail`
> > > +if [ $? != 0 ]; then
> >
> > this results in pretty ugly output, and the return value/output of `which` is
> > not portable. use the type builtin instead.
> >
> > > + MAIL_NOT_INSTALLED=1
> >
> > you should make sure this is always set/unset at the top of the script so
> > parent environment poisoning wont screw things up.
> >
> > > +if [ -z $MAIL_NOT_INSTALLED ]; then
> >
> > tests must always be quoted:
> > [ -z "$foo" ]
>
> Worse, as $MAIL_NOT_INSTALLED is always "0" or "1", -z always return false...
>
> From 8035091c4232e8d6c7b3a75d612bc82c1ad84365 Mon Sep 17 00:00:00 2001
> From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> Date: Thu, 27 Aug 2009 14:11:58 +0200
> Subject: [PATCH] Fix mail_tests for systems with mail installed
>
> `-z' tests for a string length of zero, not for a zero value, causing the
> test always to return false.
> Initialize $MAIL_NOT_INSTALLED to an empty string instead of a numerical
> zero to fix this.
>
> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Ok. Thanks.
Regards--
Subrata
> ---
> testcases/commands/mail/mail_tests.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh
> index 0959a0c..45bac93 100755
> --- a/testcases/commands/mail/mail_tests.sh
> +++ b/testcases/commands/mail/mail_tests.sh
> @@ -59,7 +59,7 @@ RC=0
> export TCID=SETUP
> export TST_COUNT=1
>
> -MAIL_NOT_INSTALLED=0
> +MAIL_NOT_INSTALLED=
> `type mail &> /dev/null`
> if [ $? != 0 ]; then
> MAIL_NOT_INSTALLED=1
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2009-08-28 6:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 21:14 [LTP] fix mail_tests for systems without mail installed Paul Larson
2009-08-13 7:04 ` Mike Frysinger
2009-08-27 12:19 ` Geert Uytterhoeven
2009-08-28 6:09 ` Subrata Modak [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-08-19 18:20 Paul Larson
2009-08-23 7:28 ` Subrata Modak
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=1251439768.9081.11.camel@subratamodak.linux.ibm.com \
--to=subrata@linux.vnet.ibm.com \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=vapier@gentoo.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