X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=test%2Fruntest;h=5f77e625652785b7beea3f5717c25a44ca14af39;hp=d24f4bba293e34f1f5e48fa5c470eace242b9b21;hb=17c761988f30054827a9951761d93ffeeaad0cb7;hpb=cfc5483092684ed5775a8e0d9b3071ee2c37780c diff --git a/test/runtest b/test/runtest index d24f4bba2..5f77e6256 100755 --- a/test/runtest +++ b/test/runtest @@ -1,7 +1,5 @@ #! /usr/bin/perl -w -# $Cambridge: exim/test/runtest,v 1.15 2006/10/31 11:37:47 ph10 Exp $ - ############################################################################### # This is the controlling script for the "new" test suite for Exim. It should # # be possible to export this suite for running on a wide variety of hosts, in # @@ -15,17 +13,19 @@ # Placed in the Exim CVS: 06 February 2006 # ############################################################################### +#use strict; require Cwd; use Errno; use FileHandle; use Socket; +use Time::Local; # Start by initializing some global variables -$testversion = "4.64 (05-Sep-06)"; +$testversion = "4.78 (08-May-12)"; -$cf = "bin/cf"; +$cf = "bin/cf -exact"; $cr = "\r"; $debug = 0; $force_update = 0; @@ -120,6 +120,12 @@ s?\bV6NET:?$parm_ipv6_test_net:?g; } +################################################## +# Any state to be preserved across tests # +################################################## + +my $TEST_STATE = {}; + ################################################## # Subroutine to tidy up and exit # @@ -142,6 +148,13 @@ my($spool); # than SIGTERM to stop it outputting "Terminated" to the terminal when not in # the background. +if (exists $TEST_STATE->{exim_pid}) + { + $pid = $TEST_STATE->{exim_pid}; + print "Tidyup: killing wait-mode daemon pid=$pid\n"; + system("sudo kill -SIGINT $pid"); + } + if (opendir(DIR, "spool")) { my(@spools) = sort readdir(DIR); @@ -198,14 +211,26 @@ return $newid; } -# This is used while munging the output from exim_dumpdb. We cheat by assuming -# that the date always the same, and just return the number of seconds since -# midnight. +# This is used while munging the output from exim_dumpdb. +# May go wrong across DST changes. sub date_seconds { my($day,$month,$year,$hour,$min,$sec) = $_[0] =~ /^(\d\d)-(\w\w\w)-(\d{4})\s(\d\d):(\d\d):(\d\d)/; -return $hour * 60 * 60 + $min * 60 + $sec; +my($mon); +if ($month =~ /Jan/) {$mon = 0;} +elsif($month =~ /Feb/) {$mon = 1;} +elsif($month =~ /Mar/) {$mon = 2;} +elsif($month =~ /Apr/) {$mon = 3;} +elsif($month =~ /May/) {$mon = 4;} +elsif($month =~ /Jun/) {$mon = 5;} +elsif($month =~ /Jul/) {$mon = 6;} +elsif($month =~ /Aug/) {$mon = 7;} +elsif($month =~ /Sep/) {$mon = 8;} +elsif($month =~ /Oct/) {$mon = 9;} +elsif($month =~ /Nov/) {$mon = 10;} +elsif($month =~ /Dec/) {$mon = 11;} +return timelocal($sec,$min,$hour,$day,$mon,$year); } @@ -299,6 +324,7 @@ $spid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; while() { +RESET_AFTER_EXTRA_LINE_READ: # Check for "*** truncated ***" $yield = 1 if /\*\*\* truncated \*\*\*/; @@ -312,7 +338,8 @@ while() s?\Q$parm_cwd\E?TESTSUITE?g; # Replace the Exim version number (may appear in various places) - s/Exim \d+\.\d+[\w-]*/Exim x.yz/i; + # patchexim should have fixed this for us + #s/(Exim) \d+\.\d+[\w_-]*/$1 x.yz/i; # Replace Exim message ids by a unique series s/((?:[^\W_]{6}-){2}[^\W_]{2}) @@ -330,7 +357,8 @@ while() s/TlRMTVNTUAACAAAAAAAAAAAoAAABgg[\w+\/]+/TlRMTVNTUAACAAAAAAAAAAAoAAABggAAAEbBRwqFwwIAAAAAAAAAAAAt1sgAAAAA/; # PRVS values - s?prvs=([^/]+)/[\da-f]{10}@?prvs=$1/xxxxxxxxxx@?g; + s?prvs=([^/]+)/[\da-f]{10}@?prvs=$1/xxxxxxxxxx@?g; # Old form + s?prvs=[\da-f]{10}=([^@]+)@?prvs=xxxxxxxxxx=$1@?g; # New form # Error lines on stdout from SSL contain process id values and file names. # They also contain a source file name and line number, which may vary from @@ -338,6 +366,9 @@ while() s/^\d+:error:/pppp:error:/; s/:(?:\/[^\s:]+\/)?([^\/\s]+\.c):\d+:/:$1:dddd:/; + # There are differences in error messages between OpenSSL versions + s/SSL_CTX_set_cipher_list/SSL_connect/; + # One error test in expansions mentions base 62 or 36 s/is not a base (36|62) number/is not a base 36\/62 number/; @@ -429,8 +460,15 @@ while() # Date/time in exim -bV output s/\d\d-[A-Z][a-z]{2}-\d{4}\s\d\d:\d\d:\d\d/07-Mar-2000 12:21:52/g; + # Time on queue tolerance + s/QT=1s/QT=0s/; - # ======== Caller's login, uid, gid, home ======== + # Eximstats heading + s/Exim\sstatistics\sfrom\s\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d\sto\s + \d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d/Exim statistics from