Re-ran the conversion of all DH parameters
[exim.git] / test / runtest
index fbefff5e6d3f7cf78fe2989f9ffb0f763ea2e86c..8f49b26d3592b3392a648425186c1783a3fd1921 100755 (executable)
@@ -33,7 +33,7 @@ use File::Copy;
 
 use lib "$RealBin/lib";
 use Exim::Runtest;
-use Exim::Utils qw(uniq numerically);
+use Exim::Utils qw(uniq numerically cp);
 
 use if $ENV{DEBUG} && scalar($ENV{DEBUG} =~ /\bruntest\b/) => 'Smart::Comments' => '####';
 use if $ENV{DEBUG} && scalar($ENV{DEBUG} =~ /\bruntest\b/) => 'Data::Dumper';
@@ -749,7 +749,7 @@ RESET_AFTER_EXTRA_LINE_READ:
   s/remote delivery process \d+ ended/remote delivery process pppp ended/;
 
   # Pid in temp file in appendfile transport
-  s"test-mail/temp\.\d+\."test-mail/temp.pppp.";
+  s"test-mail/(subdir/)?temp\K\.\d+\.".pppp.";
 
   # Optional pid in log lines
   s/^(\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d)(\.\d{3}|)(\s[+-]\d{4}|)(\s\[\d+\])/
@@ -1007,7 +1007,8 @@ RESET_AFTER_EXTRA_LINE_READ:
     s/conversion: german.xn--strae-oqa.de/conversion: german.straße.de/;
 
     # subsecond timstamp info in reported header-files
-    s/^(-received_time_usec \.)\d{6}$/$1uuuuuu/;
+    s/^-received_time_usec \.\K\d{6}$/uuuuuu/;
+    s/^-received_time_complete \K\d+\.\d{6}$/tttt.uuuuuu/;
 
     # Postgres server takes varible time to shut down; lives in various places
     s/^waiting for server to shut down\.+ done$/waiting for server to shut down.... done/;
@@ -1019,6 +1020,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # ARC is not always supported by the build
     next if /^arc_sign =/;
 
+    # LIMITS is not always supported by the build
+    next if /^limits_advertise_hosts =/;
+
     # TLS resumption is not always supported by the build
     next if /^tls_resumption_hosts =/;
     next if /^-tls_resumption/;
@@ -1284,6 +1288,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # Experimental_REQUIRETLS
     next if / in tls_advertise_requiretls?\? no \(end of list\)/;
 
+    # Experimental_LIMITS
+    next if / in limits_advertise_hosts?\? no \(matched "!\*"\)/;
+
     # TCP Fast Open
     next if /^(ppppp )?setsockopt FASTOPEN: Network Error/;
 
@@ -2942,6 +2949,7 @@ GetOptions(
     'valgrind' => \$valgrind,
     'range=s{2}'       => \my @range_wanted,
     'test=i@'          => \my @tests_wanted,
+    'fail-any!'        => \my $fail_any,
     'flavor|flavour=s' => \$flavour,
     'help'             => sub { pod2usage(-exit => 0) },
     'man'              => sub {
@@ -3745,17 +3753,15 @@ system("sudo cp eximdir/exim eximdir/exim_exim;" .
 ($parm_exim_dir) = $parm_exim =~ m?^(.*)/exim?;
 
 $dbm_build_deleted = 0;
-if (defined $parm_lookups{dbm} && not copy("$parm_exim_dir/exim_dbmbuild", "eximdir"))
+if (defined $parm_lookups{dbm} && not cp("$parm_exim_dir/exim_dbmbuild", "eximdir/exim_dbmbuild"))
   {
   delete $parm_lookups{dbm};
   $dbm_build_deleted = 1;
   }
 
 foreach my $tool (qw(exim_dumpdb exim_lock exinext exigrep eximstats)) {
-  copy("$parm_exim_dir/$tool" => "eximdir/")
+  cp("$parm_exim_dir/$tool" => "eximdir/$tool")
     or tests_exit(-1, "Failed to make a copy of $tool: $!");
-  chmod((stat "$parm_exim_dir/$tool")[2]&07777, "eximdir/$tool")
-    or tests_exit(-1, "Failed to chmod $tool: $!\n");
 }
 
 # Collect some version information
@@ -4149,6 +4155,7 @@ if (not $force_continue) {
 }
 
 
+my $failures = 0;
 foreach $test (@test_list)
   {
   state $lasttestdir = '';
@@ -4382,10 +4389,12 @@ foreach $test (@test_list)
         print "\nshow stdErr, show stdOut, Retry, Continue (without file comparison), or Quit? [Q] ";
         $_ = $force_continue ? "c" : <T>;
         tests_exit(1) if /^q?$/i;
-       if (/^c$/ && $force_continue) {
-         log_failure($log_failed_filename, $testno, "exit code unexpected");
-         log_test($log_summary_filename, $testno, 'F')
-       }
+        if (/^c$/ && $force_continue)
+          {
+          log_failure($log_failed_filename, $testno, "exit code unexpected");
+          log_test($log_summary_filename, $testno, 'F');
+          $failures++;
+          }
         if ($force_continue)
           {
           print "\nstdout tail:\n";
@@ -4449,10 +4458,12 @@ foreach $test (@test_list)
           print "\nShow server stdout, Retry, Continue, or Quit? [Q] ";
           $_ = $force_continue ? "c" : <T>;
           tests_exit(1) if /^q?$/i;
-         if (/^c$/ && $force_continue) {
-           log_failure($log_failed_filename, $testno, "exit code unexpected");
-           log_test($log_summary_filename, $testno, 'F')
-         }
+          if (/^c$/ && $force_continue)
+            {
+            log_failure($log_failed_filename, $testno, "exit code unexpected");
+            log_test($log_summary_filename, $testno, 'F');
+            $failures++;
+            }
           print "... continue forced\n" if $force_continue;
           last if /^[rc]$/i;
 
@@ -4487,7 +4498,14 @@ foreach $test (@test_list)
     {
     sleep 1 if $slow;
     my $rc = check_output($TEST_STATE->{munge});
-    log_test($log_summary_filename, $testno, 'P') if ($rc == 0);
+    if ($rc == 0)
+      {
+      log_test($log_summary_filename, $testno, 'P');
+      }
+    else
+      {
+      $failures++;
+      }
     if ($rc < 2)
       {
       print ("  Script completed\n");
@@ -4506,7 +4524,7 @@ foreach $test (@test_list)
 ##################################################
 
 tests_exit(-1, "No runnable tests selected") if not @test_list;
-tests_exit(0);
+tests_exit($fail_any ? $failures : 0);
 
 __END__