X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2Flib%2FDebbugsTest.pm;h=df280061512421f67fe3045652ab8810cc3c1567;hb=e39aa3a1a8e5e4a7d8e86aeafb4aa2868f8c8a5e;hp=f203668c7c1af29385c9c6a7e51bfffa0a57d0ca;hpb=9e9c6dbc3a745c02b69b76eeb763525bf44befc3;p=debbugs.git diff --git a/t/lib/DebbugsTest.pm b/t/lib/DebbugsTest.pm index f203668..df28006 100644 --- a/t/lib/DebbugsTest.pm +++ b/t/lib/DebbugsTest.pm @@ -88,10 +88,12 @@ END "$spool_dir/nextnumber" => qq(1\n), "$config_dir/Maintainers" => qq(foo Blah Bleargh \nbar Bar Bleargh \n), "$config_dir/Maintainers.override" => qq(), + "$config_dir/Source_maintainers" => qq(foo Blah Bleargh \nbar Bar Bleargh \n), "$config_dir/indices/sources" => < '', + "$config_dir/pseudo-packages.maintainers" => '', ); while (my ($file,$contents) = each %files_to_create) { system('mkdir','-p',dirname($file)); @@ -109,9 +111,11 @@ END "$spool_dir/index.archive"); # create the spool files and sub directories - map {system('mkdir','-p',"$spool_dir/$_"); } - map {('db-h/'.$_,'archive/'.$_)} - map { sprintf "%02d",$_ % 100} 0..99; + for my $dir (0..99) { + for my $archive (qw(db-h archive)) { + system('mkdir','-p',"$spool_dir/$archive/".sprintf('%02d',$dir)); + } + } system('mkdir','-p',"$spool_dir/incoming"); system('mkdir','-p',"$spool_dir/lock"); @@ -143,6 +147,9 @@ sub send_message{ }, body => {type => SCALAR, }, + attachments => {type => ARRAYREF, + default => [], + }, run_processall =>{type => BOOLEAN, default => 1, }, @@ -151,13 +158,17 @@ sub send_message{ $ENV{LOCAL_PART} = $param{to}; my ($rfd,$wfd); my $output=''; - local $SIG{PIPE} = 'IGNORE'; - local $SIG{CHLD} = sub {}; + my $pipe_handler = $SIG{PIPE}; + $SIG{PIPE} = 'IGNORE'; + $SIG{CHLD} = 'DEFAULT'; my $pid = open3($wfd,$rfd,$rfd,'scripts/receive') or die "Unable to start receive: $!"; print {$wfd} create_mime_message($param{headers}, - $param{body}) or die "Unable to to print to receive"; + $param{body}, + $param{attachments}) or + die "Unable to to print to receive"; close($wfd) or die "Unable to close receive"; + $SIG{PIPE} = $pipe_handler; my $err = $? >> 8; my $childpid = waitpid($pid,0); if ($childpid != -1) {