X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/93c3f40d578a22c112fd67954528f921dae50a78..a173a4376d168edbf3fe2494dff998c4060bf425:/test/runtest diff --git a/test/runtest b/test/runtest index 1730a9889..45d00f9f8 100755 --- a/test/runtest +++ b/test/runtest @@ -18,7 +18,6 @@ #use strict; use v5.10.1; use warnings; -use if $^V >= v5.19.11, experimental => 'smartmatch'; use Errno; use FileHandle; @@ -1074,7 +1073,18 @@ RESET_AFTER_EXTRA_LINE_READ: s/250-AUTH ANONYMOUS PLAIN SCRAM-SHA-1\K SCRAM-SHA-256//; # mailq times change with when the run is done, vs. static-source spoolfiles - s/\s*\d*[hd](?= 317 [0-9A-Za-z\-]{23} )/DDd/; + s/\s*\d*[hd](?= 317 (?:[-0-9A-Za-z]{23}|[-0-9A-Za-z]{16}) )/DDd/; + # mailq sizes change with caller running the test + s/\s[01]m [34]\d\d(?= (?:[-0-9A-Za-z]{23}|[-0-9A-Za-z]{16}) )/ 1m 396/; + + # Not all builds include EXPERIMENTAL_DSN_INFO (1 of 2) + if (/^X-Exim-Diagnostic:/) + { + while () { + last if (/^$/ || !/^\s/); + } + goto RESET_AFTER_EXTRA_LINE_READ; + } } # ======== stderr ======== @@ -1555,7 +1565,7 @@ RESET_AFTER_EXTRA_LINE_READ: next if / Berkeley DB error: /; # CHUNKING: exact sizes depend on hostnames in headers - s/(=>.* K C="250- \d)\d+ (byte chunk, total \d)\d+/$1nn $2nn/; + s/(=>.* K (?:DKIM=\S+ )?C="250- \d)\d+ (byte chunk, total \d)\d+/$1nn $2nn/; # OpenSSL version variances s/(TLS error on connection [^:]*: error:)[0-9A-F]{8}(:system library):(?:fopen|func\(4095\)|):(No such file or directory)$/$1xxxxxxxx$2:fopen:$3/; @@ -1584,11 +1594,13 @@ RESET_AFTER_EXTRA_LINE_READ: s/ARC: AMS signing: privkey PEM-block import: error:\K[0-9A-F]{8}:PEM routines:PEM_read_bio:no start line$/1E08010C:DECODER routines::unsupported/; # DKIM timestamps - if ( /(DKIM: d=.*) t=([0-9]*) x=([0-9]*) / ) + if ( /(DKIM: d=.*) t=([0-9]*) x=([0-9]*) \[/ ) { my ($prefix, $t_diff) = ($1, $3 - $2); s/DKIM: d=.* t=[0-9]* x=[0-9]* /${prefix} t=T x=T+${t_diff} /; } + else + { s/DKIM: d=.* \Kt=[0-9]* \[/t=T [/; } # GnuTLS reports a different keysize vs. OpenSSL, for ed25519 keys s/signer: [^ ]* bits:\K 256/ 253/; s/public key too short:\K 256 bits/ 253 bits/; @@ -1631,6 +1643,22 @@ RESET_AFTER_EXTRA_LINE_READ: ; ; } + elsif ( /^(\s+)t=([0-9]*); b=[A-Za-z0-9+\/]+$/ ) + { + my $indent = $1; + s/.*/${indent}t=T; b=bbbb;/; + ; + ; + } + + # Not all builds include EXPERIMENTAL_DSN_INFO (2 of 2) + if (/^X-Exim-Diagnostic:/) + { + while () { + last if (/^$/ || !/^\s/); + } + goto RESET_AFTER_EXTRA_LINE_READ; + } } # ======== All files other than stderr ======== @@ -2639,6 +2667,12 @@ if (/^(ln|ls|du|mkdir|mkfifo|touch|cp|cat)\s/ || run_system("$_ >>test-stdout 2>>test-stderr"); return 1; } +if (/^cat2\s/) + { + s/^cat2/cat/; + run_system("$_ 2>&1 >test-stderr"); + return 1; + } @@ -3376,6 +3410,7 @@ GetOptions( print "Exim binary is `$parm_exim'\n" if defined $parm_exim; +my %wanted; my @wanted = sort numerically uniq @tests_wanted ? @tests_wanted : (), @range_wanted ? $range_wanted[0] .. $range_wanted[1] : (), @@ -3384,6 +3419,7 @@ my @wanted = sort numerically uniq 0+$ARGV[0]..0+$ARGV[1] # add 0 to cope with test numbers starting with zero : (); @wanted = 1..TEST_TOP if not @wanted; +map { $wanted{sprintf("%04d",$_)}= $_; } @wanted; ################################################## # Check for sudo access to root # @@ -4196,7 +4232,8 @@ DIR: for (my $i = 0; $i < @test_dirs; $i++) # We want the tests from this subdirectory, provided they are in the # range that was selected. - @testlist = grep { $_ ~~ @wanted } grep { /^\d+(?:\.\d+)?$/ } map { basename $_ } glob "scripts/$testdir/*"; + undef @testlist; + map { push @testlist, $_ if exists $wanted{$_} } grep { /^\d+(?:\.\d+)?$/ } map { basename $_ } glob "scripts/$testdir/*"; tests_exit(-1, "Failed to read test scripts from `scripts/$testdir/*': $!") if not @testlist;