Patchwork [3,of,4] test-patchbomb.t: add test for case where sendmail fails

login
register
mail settings
Submitter Bryan O'Sullivan
Date Jan. 5, 2016, 5:56 a.m.
Message ID <3838e999a656ccd5644f.1451973369@bryano-mbp.local>
Download mbox | patch
Permalink /patch/12519/
State Changes Requested
Delegated to: Yuya Nishihara
Headers show

Comments

Bryan O'Sullivan - Jan. 5, 2016, 5:56 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Date 1451973286 28800
#      Mon Jan 04 21:54:46 2016 -0800
# Node ID 3838e999a656ccd5644fadac75ed91f15ad22854
# Parent  1dcd7d9c98ffab398482b07c539c9520235588e8
test-patchbomb.t: add test for case where sendmail fails

Notice that the wrong error code is reported. To be continued...
Yuya Nishihara - Jan. 6, 2016, 1:03 p.m.
On Mon, 04 Jan 2016 21:56:09 -0800, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bos@serpentine.com>
> # Date 1451973286 28800
> #      Mon Jan 04 21:54:46 2016 -0800
> # Node ID 3838e999a656ccd5644fadac75ed91f15ad22854
> # Parent  1dcd7d9c98ffab398482b07c539c9520235588e8
> test-patchbomb.t: add test for case where sendmail fails
> 
> Notice that the wrong error code is reported. To be continued...
> 
> diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
> --- a/tests/test-patchbomb.t
> +++ b/tests/test-patchbomb.t
> @@ -2816,7 +2816,9 @@ bad value setting
>  
>    $ echo 'intro=mpmwearaclownnose' >> $HGRCPATH
>  
> -single rev
> +single rev, and introduce a deliberate fake sendmail failure
> +
> +  $ echo exit 78 >> pretendmail.sh
>  
>    $ hg email  --date '1980-1-1 0:1' -v -t foo -s test -r '10'
>    From [test]: test
> @@ -2858,6 +2860,8 @@ single rev
>    
>    sending [PATCH] test ...
>    sending mail: $TESTTMP/t2/pretendmail.sh -f test foo
> +  abort: pretendmail.sh exited with status 19968
> +  [255]

Just FYI, this is the same issue as
http://bz.mercurial-scm.org/show_bug.cgi?id=4746

Patch

diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t
--- a/tests/test-patchbomb.t
+++ b/tests/test-patchbomb.t
@@ -2816,7 +2816,9 @@  bad value setting
 
   $ echo 'intro=mpmwearaclownnose' >> $HGRCPATH
 
-single rev
+single rev, and introduce a deliberate fake sendmail failure
+
+  $ echo exit 78 >> pretendmail.sh
 
   $ hg email  --date '1980-1-1 0:1' -v -t foo -s test -r '10'
   From [test]: test
@@ -2858,6 +2860,8 @@  single rev
   
   sending [PATCH] test ...
   sending mail: $TESTTMP/t2/pretendmail.sh -f test foo
+  abort: pretendmail.sh exited with status 19968
+  [255]
 Test pull url header
 =================================