X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=test%2Fruntest;h=b2f5d077573e6c0f9c60ad82e95cdfbc48bd7b10;hb=e1d04f48a45c9f8e8ff75610003048f8ead73219;hp=a6560aaa717adbe0a9365b1623fc1126178b2bba;hpb=adc426215052297d694fcc08786e87a140171e76;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/test/runtest b/test/runtest index a6560aaa7..b2f5d0775 100755 --- a/test/runtest +++ b/test/runtest @@ -1515,7 +1515,7 @@ $munges = )($|[ ]=)/x' }, 'sys_bindir' => - { 'mainlog' => 's%/(usr/)?bin/%SYSBINDIR/%' }, + { 'mainlog' => 's%/(usr/(local/)?)?bin/%SYSBINDIR/%' }, 'sync_check_data' => { 'mainlog' => 's/^(.* SMTP protocol synchronization error .* next input=.{8}).*$/$1/', @@ -2266,14 +2266,20 @@ elsif (/^((?i:[A-Z\d_]+=\S+\s+)+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+ if ($args =~ /\$msg/) { - my($listcmd) = "$parm_cwd/eximdir/exim -bp " . - "-DEXIM_PATH=$parm_cwd/eximdir/exim " . - "-C $parm_cwd/test-config |"; - print ">> Getting queue list from:\n>> $listcmd\n" if ($debug); - open (QLIST, $listcmd) || tests_exit(-1, "Couldn't run \"exim -bp\": $!\n"); - my(@msglist) = (); - while () { push (@msglist, $1) if /^\s*\d+[smhdw]\s+\S+\s+(\S+)/; } - close(QLIST); + my @listcmd = ("$parm_cwd/eximdir/exim", '-bp', + "-DEXIM_PATH=$parm_cwd/eximdir/exim", + -C => "$parm_cwd/test-config"); + print ">> Getting queue list from:\n>> @listcmd\n" if $debug; + # We need the message ids sorted in ascending order. + # Message id is: --. On some systems (*BSD) the + # PIDs are randomized, so sorting just the whole PID doesn't work. + # We do the Schartz' transformation here (sort on + # ). Thanks to Kirill Miazine + my @msglist = + map { $_->[1] } # extract the values + sort { $a->[0] cmp $b->[0] } # sort by key + map { [join('.' => (split /-/, $_)[0,2]) => $_] } # key (timestamp.fractional-time) => value(message_id) + map { /^\s*\d+[smhdw]\s+\S+\s+(\S+)/ } `@listcmd` or tests_exit(-1, "No output from `exim -bp` (@listcmd)\n"); # Done backwards just in case there are more than 9