Fix getting non-TLS QUIT in FIN segment
[exim.git] / test / runtest
index 1f3da963f3740b6fd3aaa170ce5c232b59bc793b..c52afceaa3f37d9a360bc6729eb6383d2e77457a 100755 (executable)
@@ -461,8 +461,8 @@ RESET_AFTER_EXTRA_LINE_READ:
     my($date1,$date2,$date3,$expired) = ($1,$2,$3,$4);
     $expired = '' if !defined $expired;
 
-    # Round the time-difference down to nearest even value
-    my($increment) = ((date_seconds($date3) - date_seconds($date2)) >> 1) << 1;
+    # Round the time-difference up to nearest even value
+    my($increment) = ((date_seconds($date3) - date_seconds($date2) + 1) >> 1) << 1;
 
     # We used to use globally unique replacement values, but timing
     # differences make this impossible. Just show the increment on the
@@ -780,7 +780,7 @@ RESET_AFTER_EXTRA_LINE_READ:
 
   # This handles "connection from" and the like, when the port is given
   if (!/listening for SMTP on/ && !/Connecting to/ && !/=>/ && !/->/
-      && !/\*>/ && !/Connection refused/)
+      && !/\*>/&& !/==/  && !/\*\*/ && !/Connection refused/ && !/in response to/)
     {
     s/\[([a-z\d:]+|\d+(?:\.\d+){3})\]:(\d+)/"[".$1."]:".new_value($2,"%s",\$next_port)/ie;
     }
@@ -1069,6 +1069,7 @@ RESET_AFTER_EXTRA_LINE_READ:
 
     # this is timing-dependent
     next if /^OpenSSL: creating STEK$/;
+    next if /^selfsign cert rotate$/;
 
     # TLS preload
     # only OpenSSL speaks of these
@@ -1288,7 +1289,7 @@ RESET_AFTER_EXTRA_LINE_READ:
     next if /\w+ in keep_environment\? (yes|no)/;
 
     # Sizes vary with test hostname
-    s/^cmd buf flush \d+ bytes$/cmd buf flush ddd bytes/;
+    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/;
@@ -1488,6 +1489,11 @@ RESET_AFTER_EXTRA_LINE_READ:
 
     # Platform differences in errno strings
     s/Arg list too long/Argument list too long/;
+
+    # OpenSSL vs. GnuTLS
+    s/session: \K\((SSL_connect|gnutls_handshake)\): timed out/(tls lib connect fn): timed out/;
+    s/TLS error on connection from .*\K\((SSL_accept|gnutls_handshake)\): timed out/(tls lib accept fn): timed out/;
+    s/TLS error on connection from .*\K(SSL_accept: TCP connection closed by peer|\(gnutls_handshake\): The TLS connection was non-properly terminated.)/(tls lib accept fn): TCP connection closed by peer/;
     }
 
   # ======== mail ========
@@ -3111,7 +3117,7 @@ if (defined $parm_trusted_config_list)
   open(TCL, $parm_trusted_config_list) or die "Can't open $parm_trusted_config_list: $!\n";
   my $test_config = getcwd() . '/test-config';
   die "Can't find '$test_config' in TRUSTED_CONFIG_LIST $parm_trusted_config_list."
-  if not grep { /^\Q$test_config\E$/ } <TCL>;
+    if not grep { /^\Q$test_config\E$/ } <TCL>;
   }
 else
   {