Testsuite: munge for error message sizes in retry records
[exim.git] / test / runtest
index 29ea66a9fd1a9814c4c4544bdcc7197533b1916f..a23d29cdcac0870d9497827bd7f461c98fe558ae 100755 (executable)
@@ -469,7 +469,7 @@ RESET_AFTER_EXTRA_LINE_READ:
   s/forced fail after \d seconds/forced fail after d seconds/;
 
   # This message may contain a different DBM library name
-  s/Failed to open \S+( \([^\)]+\))? file/Failed to open DBM file/;
+  s/Failed to open \S+( \([^\)]+\))? file/Failed to open hintsdb file/;
 
   # The message for a non-listening FIFO varies
   s/:[^:]+: while opening named pipe/: Error: while opening named pipe/;
@@ -1055,6 +1055,9 @@ RESET_AFTER_EXTRA_LINE_READ:
     # remote IPv6 addrs vary
     s/^(Connection request from) \[.*:.*:.*\]$/$1 \[ipv6\]/;
 
+    # Hints DB use of lockfiles is provider-dependent
+    s/Failed to open \K(?:hintsdb|database lock) file (.*\/spool\/db\/[^. ]*)(?:.lockfile)?(?: for reading)?(?=: No such file or directory$)/hintsdb $1/;
+
     # openssl version variances
   # 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
@@ -1152,6 +1155,10 @@ RESET_AFTER_EXTRA_LINE_READ:
                )
              /x;
 
+    # Hints DB use of lockfiles is provider-dependent
+    next if /lock(?:ing|ed) .*\/spool\/db\/[^.]+\.lockfile$/;
+    s/closed hints database\K and lockfile$//;
+
     # Lines with a leading pid.  Only handle >= 4-digit PIDs to avoid converting SMTP respose codes
     s/^\s*(\d{4,})\s(?!(?:previous message|in\s|bytes remain in|SMTP accept process running))/new_value($1, "p%s", \$next_pid) . ' '/e;
 
@@ -1284,9 +1291,6 @@ RESET_AFTER_EXTRA_LINE_READ:
     # We invoke Exim with -D, so we hit this new message as of Exim 4.73:
     next if /^macros_trusted overridden to true by whitelisting/;
 
-    # Hints-db writes seem to have variable sizes for values
-    s/ dbfn_write: key=.+ datalen \K\d+$/NNN/;
-
     # We have to omit the localhost ::1 address so that all is well in
     # the IPv4-only case.
 
@@ -1430,6 +1434,19 @@ RESET_AFTER_EXTRA_LINE_READ:
     # so convert them all to "0"
     s%(?<!lsearch)[^ ](?=TESTSUITE/aux-fixed/(?:0414.list[12]|0464.domains)$)%0%;
 
+    # Environment cleaning
+    next if /\w+ in keep_environment\? (yes|no)/;
+
+    # Sizes vary with test hostname
+    s/^cmd buf flush \d+ bytes/cmd buf flush ddd bytes/;
+
+    # Different platforms put different error messages into retry records
+    s/dbfn_write: key=.* datalen \K\d{2,3}$/nn/;
+    s/dbfn_read: size \K\d{2,3}(?= return$)/nnn/;
+
+    # Spool filesystem free space changes on different systems.
+    s/((?:spool|log) directory space =) -?\d+K (inodes =)\s*-?\d+/$1 nnnnnK $2 nnnnn/;
+
     # CONTENT_SCAN
     next if /try option acl_(?:not_)?smtp_mime$/;
 
@@ -1480,15 +1497,6 @@ RESET_AFTER_EXTRA_LINE_READ:
     next if /in tls_resumption_hosts\?/;
     next if /RE '.outlook.com/;
 
-    # Environment cleaning
-    next if /\w+ in keep_environment\? (yes|no)/;
-
-    # Sizes vary with test hostname
-    s/^cmd buf flush \d+ bytes/cmd buf flush ddd bytes/;
-
-    # Spool filesystem free space changes on different systems.
-    s/((?:spool|log) directory space =) -?\d+K (inodes =)\s*-?\d+/$1 nnnnnK $2 nnnnn/;
-
     # Non-TLS builds have different expansions for received_header_text
     if (s/(with \$received_protocol)\}\} \$\{if def:tls_cipher \{\(\$tls_cipher\)\n$/$1/)
       {