public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH] mail_tests.sh: fix a version problem of Heirloom Mail
@ 2010-02-17  8:09 Rishikesh
  2010-02-17 17:08 ` Garrett Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Rishikesh @ 2010-02-17  8:09 UTC (permalink / raw)
  To: Shi Weihua, LTP

Hi Shi,

Thanks for your patch . It will be merged in feb 2010 release.

Acked-By: Rishikesh K Rajak <risrajak@linux.vnet.ibm.com>

http://marc.info/?l=ltp-list&m=126440546415559&w=2

-- 
Thanks&  Regards
Rishi Kesh K Rajak
IBM LTC, Bangalore
LTP Maintainer
Please join IRC: #ltp @ freenode.net


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [LTP] [PATCH] mail_tests.sh: fix a version problem of Heirloom Mail
@ 2010-01-25  7:43 Shi Weihua
  0 siblings, 0 replies; 8+ messages in thread
From: Shi Weihua @ 2010-01-25  7:43 UTC (permalink / raw)
  To: ltp-list

In the previous mailx version, the command "echo "d" | mail -u root" will
output like the following.
-----------------------------
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/root": 1 message 1 new
>N  1 MAILER-DAEMON@localh  Mon Jan 25 09:11  63/2367  "Returned mail: see tr"
-----------------------------

Buy in Heirloom Mail, the command will output.
-----------------------------
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/mail/root": 1 message 1 new
>N  1 Mail Delivery Subsys  Mon Jan 25 14:16  67/2195  "Returned mail: see tr"
-----------------------------

"MAILER-DAEMON@localh" is been changed to "Mail Delivery Subsys".
We should make mail_tests.sh to supporting Heirloom Mail.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
---
--- ltp-full-20091231/testcases/commands/mail/mail_tests.sh	2009-11-16 21:25:48.000000000 +0800
+++ ltp-full-20100119/testcases/commands/mail/mail_tests.sh	2010-01-25 15:30:21.000000000 +0800
@@ -55,6 +55,25 @@ else
     LTPBIN=$LTPROOT/testcases/bin
 fi
 
+isHeirloomMail=0
+checkHeirloomMail()
+{
+    isHeirloomMail=0
+
+    if [ $# -ne 1 ]; then
+        return
+    fi
+
+    if [ ! -f $1 ]; then
+	return
+    fi
+
+    cat $1 | grep "Heirloom"
+    if [ $? -eq 0 ]; then
+	isHeirloomMail=1
+    fi
+}
+
 RC=0
 export TCID=SETUP
 export TST_COUNT=1
@@ -170,8 +189,14 @@ else
     # but wait for the mail to arrive first, sleep 5s.
     sleep 5s
     echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-    RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
-	$LTPTMP/tst_mail.res)
+    checkHeirloomMail $LTPTMP/tst_mail.res
+    if [ $isHeirloomMail -eq 0 ]; then
+	RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
+		$LTPTMP/tst_mail.res)
+    else
+	RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3 $4 $5, "MailDeliverySubsys")}' \
+		$LTPTMP/tst_mail.res)
+    fi
 ##################################################################
 # In this testcase, mail will get "Returnedmail:", while mailx will
 # get "UndeliveredMailReturned:".
@@ -181,10 +206,17 @@ else
 # or
 # /bin/mailx -> /bin/mail
 ##################################################################
-     RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
-             $LTPTMP/tst_mail.res)
-     RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
-             $LTPTMP/tst_mail.res)
+     if [ $isHeirloomMail -eq 0 ]; then
+	RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
+		$LTPTMP/tst_mail.res)
+	RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
+		$LTPTMP/tst_mail.res)
+     else
+	RC2=$(awk '/^>N/ {print match($11 $12, "Returnedmail:")}' \
+		$LTPTMP/tst_mail.res)
+	RC3=$(awk '/^>N/ {print match($11 $12, "UndeliveredMail")}' \
+		$LTPTMP/tst_mail.res)
+     fi
 fi 
     if [ -z "$RC1" -a -z "$RC2" -a -z "$RC3" ]
     then
@@ -238,8 +270,14 @@ else
     # but wait for the mail to arrive first, sleep 5s.
     sleep 5s
     echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-    RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
-	$LTPTMP/tst_mail.res)
+    checkHeirloomMail $LTPTMP/tst_mail.res
+    if [ $isHeirloomMail -eq 0 ]; then
+	RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
+		$LTPTMP/tst_mail.res)
+    else
+	RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3 $4 $5, "MailDeliverySubsys")}' \
+		$LTPTMP/tst_mail.res)
+    fi
 ##################################################################
 # In this testcase, mail will get "Returnedmail:", while mailx will
 # get "UndeliveredMailReturned:".
@@ -248,11 +286,18 @@ else
 # /bin/mail -> /bin/mailx
 # or
 # /bin/mailx -> /bin/mail
-##################################################################
-     RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
-             $LTPTMP/tst_mail.res)
-     RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
-             $LTPTMP/tst_mail.res)
+#################################################################
+     if [ $isHeirloomMail -eq 0 ]; then
+	RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
+		$LTPTMP/tst_mail.res)
+	RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
+		$LTPTMP/tst_mail.res)
+     else
+	RC2=$(awk '/^>N/ {print match($11 $12, "Returnedmail:")}' \
+		$LTPTMP/tst_mail.res)
+	RC3=$(awk '/^>N/ {print match($11 $12, "UndeliveredMail")}' \
+		$LTPTMP/tst_mail.res)
+     fi
 fi
     if [ -z "$RC1" -a -z "$RC2" -a -z "$RC3" ]
     then

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-04  8:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17  8:09 [LTP] [PATCH] mail_tests.sh: fix a version problem of Heirloom Mail Rishikesh
2010-02-17 17:08 ` Garrett Cooper
2010-02-18  3:57   ` Rishikesh K Rajak
2010-02-22  8:28     ` Shi Weihua
2010-03-02 14:46       ` Rishikesh K Rajak
2010-03-02 16:19         ` Garrett Cooper
2010-03-04  6:58           ` Shi Weihua
  -- strict thread matches above, loose matches on Subject: below --
2010-01-25  7:43 Shi Weihua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox