Testsuite: try to trace intermittent callout fails
[exim.git] / test / runtest
index 33caf204ef4d40e69cf75954b13856271694a3ac..f5e4063a8e19d8252539a0360db8f7f0aae2c9ae 100755 (executable)
@@ -772,7 +772,7 @@ RESET_AFTER_EXTRA_LINE_READ:
     }
 
   # Port in host address in spool file output from -Mvh
-  s/^-host_address (.*)\.\d+/-host_address $1.9999/;
+  s/^(--?host_address) (.*)\.\d+/$1 $2.9999/;
 
   if ($dynamic_socket and $dynamic_socket->opened and my $port = $dynamic_socket->sockport) {
     s/^Connecting to 127\.0\.0\.1 port \K$port/<dynamic port>/;
@@ -1154,6 +1154,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # remote port numbers vary
     s/(Connection request from 127.0.0.1 port) \d{1,5}/$1 sssss/;
 
+    # Platform-dependent error strings
+    s/Operation timed out/Connection timed out/;
+
     # Skip hosts_require_dane checks when the options
     # are unset, because dane ain't always there.
     next if /in\shosts_require_dane\?\sno\s\(option\sunset\)/x;
@@ -1212,26 +1215,32 @@ RESET_AFTER_EXTRA_LINE_READ:
       {
       $_ .= <IN>;
       s/ \.\.\. >>> / ... /;
+      if (s/ non-TFO mode connection attempt to 224.0.0.0, 0 data\b$//) { $_ .= <IN>; }
       s/Address family not supported by protocol family/Network Error/;
       s/Network is unreachable/Network Error/;
       }
     next if /^(ppppp )?setsockopt FASTOPEN: Protocol not available$/;
     s/^(Connecting to .* \.\.\. sending) \d+ (nonTFO early-data)$/$1 dd $2/;
 
-    if (/^([0-9: ]*Connecting to [^ ]+ [^ ]+( from [^ ]+)?) \.\.\. .*TFO mode sendto, no data: EINPROGRESS$/)
+    if (/^([0-9: ]*                                            # possible timestamp
+       Connecting\ to\ [^ ]+\ [^ ]+(\ from\ [^ ]+)?)\ \.\.\.
+       \ .*TFO\ mode\ 
+       (sendto,\ no\ data:\ EINPROGRESS                        # Linux
+       |connection\ attempt\ to\ [^,]+,\ 0\ data)              # MacOS & no-support
+       $/x)
       {
       $_ = $1 . " ... " . <IN>;
-      s/^(.* \.\.\.) [0-9: ]*connected$/$1 connected/;
+      s/^(.* \.\.\.) [0-9: ]*connected$/$1  connected/;
 
-      if (/^Connecting to .* \.\.\. connected$/)
+      if (/^Connecting to .* \.\.\.  connected$/)
        {
        $_ .= <IN>;
-       if (/^(Connecting to .* \.\.\. )connected\n\s+SMTP(\(close\)>>|\(Connection refused\)<<)$/)
+       if (/^(Connecting to .* \.\.\.  )connected\n\s+SMTP(\(close\)>>|\(Connection refused\)<<)$/)
          {
          $_ = $1 . "failed: Connection refused\n" . <IN>;
          s/^(Connecting .*)\n\s+SMTP\(close\)>>$/$1/;
          }
-       elsif (/^(Connecting to .* \.\.\. connected\n)read response data: size=/)
+       elsif (/^(Connecting to .* \.\.\.  connected\n)read response data: size=/)
          { $_ = $1; }
 
        # Date/time in SMTP banner
@@ -1255,6 +1264,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # TLS resumption is not always supported by the build
     next if /in tls_resumption_hosts\?/;
 
+    # Platform differences in errno strings
+    s/  SMTP\(Operation timed out\)<</  SMTP(Connection timed out)<</;
+
     # When Exim is checking the size of directories for maildir, it uses
     # the check_dir_size() function to scan directories. Of course, the order
     # of the files that are obtained using readdir() varies from system to
@@ -1330,6 +1342,8 @@ RESET_AFTER_EXTRA_LINE_READ:
       else
        { $_ = $prev; }
       }
+    # translate gnutls error into the openssl one
+    s/ARC: AMS signing: privkey PEM-block import: \KThe requested data were not available.$/error:0906D06C:PEM routines:PEM_read_bio:no start line/;
 
     # DKIM timestamps
     if ( /(DKIM: d=.*) t=([0-9]*) x=([0-9]*) / )
@@ -4215,6 +4229,10 @@ foreach $test (@test_list)
           print "==================>\n";
           system("tail -20 test-stderr");
           print "===================\n";
+          print "stderr-server tail:\n";
+          print "==================>\n";
+          system("tail -20 test-stderr-server");
+          print "===================\n";
           print "... continue forced\n";
           }