From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by 335xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1MbL9Q-0007or-Kj for ltp-list@lists.sourceforge.net; Wed, 12 Aug 2009 21:14:28 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by 72vjzd1.ch3.sourceforge.com with esmtp (Exim 4.69) id 1MbL9E-0007yt-MW for ltp-list@lists.sourceforge.net; Wed, 12 Aug 2009 21:14:23 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1MbL99-0002lp-9H for ; Wed, 12 Aug 2009 22:14:11 +0100 Received: from 75-27-138-126.lightspeed.austtx.sbcglobal.net ([75.27.138.126] helo=[192.168.1.70]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MbL99-0006En-2S for ltp-list@lists.sourceforge.net; Wed, 12 Aug 2009 22:14:11 +0100 Message-ID: <4A8330A1.20001@canonical.com> Date: Wed, 12 Aug 2009 16:14:09 -0500 From: Paul Larson MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090801070807060008090709" Subject: [LTP] fix mail_tests for systems without mail installed List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-list-bounces@lists.sourceforge.net To: LTP Mailing List This is a multi-part message in MIME format. --------------090801070807060008090709 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit mail_tests should return tconf instead of tfail if mail is not installed. Signed-off-by: Paul Larson --- --------------090801070807060008090709 Content-Type: text/x-patch; name="mail_tests.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mail_tests.patch" diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index 7458944..a2c6487 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -59,6 +59,11 @@ RC=0 export TCID=SETUP export TST_COUNT=1 +`which mail` +if [ $? != 0 ]; then + MAIL_NOT_INSTALLED=1 +fi + # check if the user mail_test exists on this system. # if not add that user mail_test, will removed before exiting test. RC=$(awk '/^mail_test/ {print 1}' /etc/passwd) @@ -97,6 +102,7 @@ $LTPBIN/tst_resm TINFO "Test #1: mail root@localhost will send mail to root" $LTPBIN/tst_resm TINFO "Test #1: user on local machine." +if [ -z $MAIL_NOT_INSTALLED ]; then cat > $LTPTMP/tst_mail.in < $LTPTMP/tst_mail.in < $LTPTMP/tst_mail.in <