]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/06_mail_handling.t
merge changes from don
[debbugs.git] / t / 06_mail_handling.t
index 959b80208aea11b9d1d261459cdfbfe35444f20e..f33c9dd2d2a0b9d2b5e2a74b0feea9c888c1cce6 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 64;
+use Test::More tests => 84;
 
 use warnings;
 use strict;
@@ -125,6 +125,16 @@ my @control_commands =
                            status_key => 'severity',
                            status_value => 'wishlist',
                           },
+      reassign_bar => {command => 'reassign',
+                      value   => 'bar',
+                      status_key => 'package',
+                      status_value => 'bar',
+                     },
+      reassign_foo => {command => 'reassign',
+                      value   => 'foo',
+                      status_key => 'package',
+                      status_value => 'foo',
+                     },
       'found_1.0'        => {command => 'found',
                             value   => '1.0',
                             status_key => 'found_versions',
@@ -196,6 +206,26 @@ my @control_commands =
                       status_key => 'owner',
                       status_value => '',
                      },
+      summary      => {command => 'summary',
+                      value   => '5',
+                      status_key => 'summary',
+                      status_value => 'This is a silly bug',
+                     },
+      nosummary    => {command => 'summary',
+                      value   => '',
+                      status_key => 'summary',
+                      status_value => '',
+                     },
+      affects      => {command => 'affects',
+                      value   => 'foo',
+                      status_key => 'affects',
+                      status_value => 'foo',
+                     },
+      noaffects    => {command => 'affects',
+                      value   => '',
+                      status_key => 'affects',
+                      status_value => '',
+                     },
       close        => {command => 'close',
                       value   => '',
                       status_key => 'done',
@@ -228,6 +258,7 @@ while (my ($command,$control_command) = splice(@control_commands,0,2)) {
                              Subject => "Munging a bug with $command",
                             ],
                  body => <<EOF) or fail 'message to control@bugs.something failed';
+debug 10
 $control_command->{command} 1$control_command->{value}
 thanks
 EOF
@@ -246,3 +277,24 @@ EOF
      is_deeply($status->{$control_command->{status_key}},$control_command->{status_value},"bug 1 $command")
          or fail(Dumper($status));
 }
+
+# verify that archive/unarchive can then be modified afterwards
+
+send_message(to => 'control@bugs.something',
+            headers => [To   => 'control@bugs.something',
+                        From => 'foo@bugs.something',
+                        Subject => "Munging a bug with unarchivearchive",
+                       ],
+            body => <<'EOF') or fail 'message to control@bugs.something failed';
+archive 1
+unarchive 1
+submitter 1 bar@baz.com
+thanks
+EOF
+                                 ;
+$SD_SIZE_NOW = dirsize($sendmail_dir);
+ok($SD_SIZE_NOW-$SD_SIZE_PREV >= 1,'control@bugs.something messages appear to have been sent out properly');
+$SD_SIZE_PREV=$SD_SIZE_NOW;
+# now we need to check to make sure the control message was processed without errors
+ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: Processed: Munging a bug with unarchivearchive")) == 0,
+   'control@bugs.something'. "unarchive/archive message was parsed without errors");