Skip to contentSkip to conversation

About mail test

LTP Mitani 3 participants 6 messages Mar 30, 2010 – Apr 15, 2010

lore
Share & tools
lore

Mitani

author
#0 lore raw

Hi,

I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think.

1) About judgment for making a user name
In line 80 of "mail_tests.sh", there is following sentence.
------------
if id -u mail_test >/dev/null 2>&1; then
------------
This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think.
But this sentence is not effective.
Therefore the user name "make_test" cannot be made when this user name isn't exist.

2) About "blind carbon copy" option
In "mail_tests.sh", there are 5 tests about mail.
5th is "blind carbon copy" test.
However, this test doesn't use "-b" option but uses "-c" option.

Please consider the following revision.
============
--- ./testcases/commands/mail/mail_tests.sh 2010-03-23
17:56:21.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-03-30 10:39:40.000000000 +0900
@@ -77,7 +77,8 @@

 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
        tst_resm TINFO "INIT: Adding temporary user mail_test"
        useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1
        if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 # send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \
@@ -344,10 +345,10 @@
        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
                tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user mail_test"
+                   "Test #5: Mail was blind carbon copied to user
mail_test"
        else
                tst_res TFAIL $LTPTMP/tst_mail.res \

- "Test #5: mail failed to carbon copy user mail_test.
Reason:"
+ "Test #5: mail failed to blind carbon copy user
mail_test. Reason:"

                : $(( TFAILCNT += 1 ))
        fi

============

Thank you--

-Tomonori Mitani

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

Hi Mitani,

can you please sign off ? And also send me a patch against today's git.

-Rishi

Quoted 84 lines · Mitani

Hi,

I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think.

1) About judgment for making a user name
In line 80 of "mail_tests.sh", there is following sentence.
------------
if id -u mail_test >/dev/null 2>&1; then
------------
This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think.
But this sentence is not effective.
Therefore the user name "make_test" cannot be made when this user name isn't exist.

2) About "blind carbon copy" option
In "mail_tests.sh", there are 5 tests about mail.
5th is "blind carbon copy" test.
However, this test doesn't use "-b" option but uses "-c" option.

Please consider the following revision.
============
--- ./testcases/commands/mail/mail_tests.sh 2010-03-23
17:56:21.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-03-30 10:39:40.000000000 +0900

(quoted diff) +4 -3
@@ -77,7 +77,8 @@
 
 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
        tst_resm TINFO "INIT: Adding temporary user mail_test"
        useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1
        if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 
 # send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \
@@ -344,10 +345,10 @@
 
        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
                tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user mail_test"
+                   "Test #5: Mail was blind carbon copied to user

mail_test"

        else
                tst_res TFAIL $LTPTMP/tst_mail.res \

- "Test #5: mail failed to carbon copy user mail_test.
Reason:"
+ "Test #5: mail failed to blind carbon copy user
mail_test. Reason:"

                : $(( TFAILCNT += 1 ))
        fi

============

Thank you--

-Tomonori Mitani

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Signature · 16 lines
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
author
#2 lore raw

Hi,

I try to suggest patch again by advice of Rishi.
This patch is for ltp-dev-4837fee8a7c2de6a83c8927a574c792ca6dabe4e.tar.gz .

Index: ./testcases/commands/mail/mail_tests.sh
============
--- ./testcases/commands/mail/mail_tests.sh 2010-04-01
16:15:00.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-04-01 20:54:40.000000000 +0900
@@ -77,7 +77,8 @@

 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
        tst_resm TINFO "INIT: Adding temporary user mail_test"
        useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1
        if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 # send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \
@@ -344,10 +345,10 @@
        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
                tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user mail_test"
+                   "Test #5: Mail was blind carbon copied to user
mail_test"
        else
                tst_res TFAIL $LTPTMP/tst_mail.res \

- "Test #5: mail failed to carbon copy user mail_test.
Reason:"
+ "Test #5: mail failed to blind carbon copy user
mail_test. Reason:"

                : $(( TFAILCNT += 1 ))
        fi

============

Thank you--

-Tomonori Mitani

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#3 lore raw
In reply to Rishikesh K Rajak

Sorry.
My patch was destroyed by e-mail.
I attach patch for "mail_tests.sh" file.

Regards--

-Tomonori Mitani

Quoted 106 lines

-----Original Message-----
From: Rishikesh K Rajak [mailto:[email protected]]
Sent: Thursday, April 01, 2010 3:57 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] About mail test

Hi Mitani,

can you please sign off ? And also send me a patch against today's git.

-Rishi

Quoted 6 lines · Mitani

Hi,

I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think.

Quoted 9 lines

1) About judgment for making a user name
In line 80 of "mail_tests.sh", there is following sentence.
------------
if id -u mail_test >/dev/null 2>&1; then
------------
This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think. But this sentence is not effective.
Therefore the user name "make_test" cannot be made when this user

name

Quoted 16 lines

isn't exist.

2) About "blind carbon copy" option
In "mail_tests.sh", there are 5 tests about mail.
5th is "blind carbon copy" test.
However, this test doesn't use "-b" option but uses "-c" option.

Please consider the following revision.
============
--- ./testcases/commands/mail/mail_tests.sh 2010-03-23
17:56:21.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-03-30 10:39:40.000000000 +0900

Review line 83

Quoted 8 lines
(quoted diff) +2 -1
@@ -77,7 +77,8 @@
 
 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
        tst_resm TINFO "INIT: Adding temporary user mail_test"
        useradd -m -s /sbin/nologin mail_test >

$LTPTMP/tst_mail.out 2>&1

Quoted 11 lines
(quoted diff) +1 -1
        if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 
 # send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \

Review line 347

Quoted 4 lines
(quoted diff) +0 -1
@@ -344,10 +345,10 @@
 
        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
                tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user

mail_test"

Quoted 5 lines
(quoted diff) +1 -0
+                   "Test #5: Mail was blind carbon copied to user

mail_test"

        else
                tst_res TFAIL $LTPTMP/tst_mail.res \

- "Test #5: mail failed to carbon copy user

mail_test.

Quoted 6 lines

Reason:"
+ "Test #5: mail failed to blind carbon copy user
mail_test. Reason:"

                : $(( TFAILCNT += 1 ))
        fi
Quoted 10 lines

============

Thank you--

-Tomonori Mitani

------------------------------------------------------------------
------------

Quoted 9 lines

Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Quoted 6 lines

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

testcases/commands/mail/mail_tests.sh +5 -4
@@ -77,7 +77,8 @@
 
 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
 	tst_resm TINFO "INIT: Adding temporary user mail_test"
 	useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1
 	if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 
 # send mail to root and carbon copy mail_test 
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
 	$LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
 	tst_res TFAIL $LTPTMP/tst_mail.out \
@@ -344,10 +345,10 @@
 
 	if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
 		tst_resm TPASS \
-		    "Test #5: Mail was carbon copied to user mail_test"
+		    "Test #5: Mail was blind carbon copied to user mail_test"
 	else
 		tst_res TFAIL $LTPTMP/tst_mail.res \
-		    "Test #5: mail failed to carbon copy user mail_test. Reason:"
+		    "Test #5: mail failed to blind carbon copy user mail_test. Reason:"
 		: $(( TFAILCNT += 1 ))
 	fi
 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
Quoted 3 lines · Mitani

Sorry.
My patch was destroyed by e-mail.
I attach patch for "mail_tests.sh" file.

Applied to next branch. Will wait for someone to Acked/test it before merging to master.

Thanks
-Rishi

Quoted 121 lines

Regards--

-Tomonori Mitani

Quoted 112 lines

-----Original Message-----
From: Rishikesh K Rajak [mailto:[email protected]]
Sent: Thursday, April 01, 2010 3:57 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] About mail test

Hi Mitani,

can you please sign off ? And also send me a patch against today's git.

-Rishi

Quoted 6 lines · Mitani

Hi,

I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think.

Quoted 9 lines

1) About judgment for making a user name
In line 80 of "mail_tests.sh", there is following sentence.
------------
if id -u mail_test >/dev/null 2>&1; then
------------
This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think. But this sentence is not effective.
Therefore the user name "make_test" cannot be made when this user

name

Quoted 16 lines

isn't exist.

2) About "blind carbon copy" option
In "mail_tests.sh", there are 5 tests about mail.
5th is "blind carbon copy" test.
However, this test doesn't use "-b" option but uses "-c" option.

Please consider the following revision.
============
--- ./testcases/commands/mail/mail_tests.sh 2010-03-23
17:56:21.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-03-30 10:39:40.000000000 +0900

testcases/commands/mail/mail_tests.sh line 83

Quoted 8 lines
testcases/commands/mail/mail_tests.sh +2 -1
@@ -77,7 +77,8 @@
 
 # check if the user mail_test exists on this system.
 # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
        tst_resm TINFO "INIT: Adding temporary user mail_test"
        useradd -m -s /sbin/nologin mail_test >

$LTPTMP/tst_mail.out 2>&1

Quoted 11 lines
testcases/commands/mail/mail_tests.sh +1 -1
        if [ $? -ne 0 ]; then
@@ -327,7 +328,7 @@
 tst_resm TINFO "Test #5: blind carbon copy user@domain"
 
 # send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \
        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \

testcases/commands/mail/mail_tests.sh line 347

Quoted 4 lines
testcases/commands/mail/mail_tests.sh +0 -1
@@ -344,10 +345,10 @@
 
        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
                tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user

mail_test"

Quoted 5 lines
(quoted diff) +1 -0
+                   "Test #5: Mail was blind carbon copied to user

mail_test"

        else
                tst_res TFAIL $LTPTMP/tst_mail.res \

- "Test #5: mail failed to carbon copy user

mail_test.

Quoted 6 lines

Reason:"
+ "Test #5: mail failed to blind carbon copy user
mail_test. Reason:"

                : $(( TFAILCNT += 1 ))
        fi
Quoted 10 lines

============

Thank you--

-Tomonori Mitani

------------------------------------------------------------------
------------

Quoted 9 lines

Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

Signature · 16 lines
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#5 lore raw
Quoted 5 lines · Rishikesh K Rajak
Quoted 3 lines · Mitani

Sorry.
My patch was destroyed by e-mail.
I attach patch for "mail_tests.sh" file.

Quoted 99 lines

Applied to next branch. Will wait for someone to Acked/test it before merging to master.

Thanks
-Rishi

Quoted 94 lines

Regards--

-Tomonori Mitani

Quoted 85 lines

-----Original Message-----
From: Rishikesh K Rajak [mailto:[email protected]]
Sent: Thursday, April 01, 2010 3:57 PM
To: Mitani
Cc: [email protected]
Subject: Re: [LTP] About mail test

Hi Mitani,

can you please sign off ? And also send me a patch against today's git.

-Rishi

Quoted 6 lines · Mitani

Hi,

I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think.

Quoted 9 lines

1) About judgment for making a user name
In line 80 of "mail_tests.sh", there is following sentence.
------------
if id -u mail_test >/dev/null 2>&1; then
------------
This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think. But this sentence is not effective.
Therefore the user name "make_test" cannot be made when this user

name

Quoted 22 lines

isn't exist.

2) About "blind carbon copy" option
In "mail_tests.sh", there are 5 tests about mail.
5th is "blind carbon copy" test.
However, this test doesn't use "-b" option but uses "-c" option.

Please consider the following revision.
============
--- ./testcases/commands/mail/mail_tests.sh     2010-03-23 17:56:21.000000000 +0900
+++ ./testcases/commands/mail/mail_tests.sh.new 2010-03-30 10:39:40.000000000 +0900

testcases/commands/mail/mail_tests.sh +2 -1
@@ -77,7 +77,8 @@
 
  # check if the user mail_test exists on this system.
  # if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
+id -u mail_test >/dev/null 2>&1
+if [ $? -ne 0 ] ; then
Quoted 2 lines

        tst_resm TINFO "INIT: Adding temporary user mail_test" useradd -m -s /sbin/nologin mail_test >

$LTPTMP/tst_mail.out 2>&1

Quoted 12 lines

        if [ $? -ne 0 ]; then

(quoted diff) +0 -0
@@ -327,7 +328,7 @@

 tst_resm TINFO "Test #5: blind carbon copy user@domain"

 # send mail to root and carbon copy mail_test
testcases/commands/mail/mail_tests.sh +1 -1
-mail -s "Test" root@localhost -c mail_test@localhost < \
+mail -s "Test" root@localhost -b mail_test@localhost < \

        $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then
        tst_res TFAIL $LTPTMP/tst_mail.out \

(quoted diff) +0 -0
@@ -344,10 +345,10 @@
 
Quoted 3 lines

        if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then tst_resm TPASS \
-                   "Test #5: Mail was carbon copied to user

mail_test"

Quoted 5 lines

+                   "Test #5: Mail was blind carbon copied to user mail_test"
        else
                tst_res TFAIL $LTPTMP/tst_mail.res \
-                   "Test #5: mail failed to carbon copy user

mail_test.

Quoted 7 lines

Reason:"
+                   "Test #5: mail failed to blind carbon copy user mail_test. Reason:"
                : $(( TFAILCNT += 1 ))
        fi

============

Apart from the comment above the BCC test being incorrect, everything looks fine.

-Garrett

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list