# We use env, because in some environments of our build farm
# the Perl 5.010 interpreter is only reachable via $PATH
+# Copyright (c) The Exim Maintainers 2024
+# SPDX-License-Identifier: GPL-2.0-or-later
+
###############################################################################
# This is the controlling script for the "new" test suite for Exim. It should #
# be possible to export this suite for running on a wide variety of hosts, in #
my ($parm_ipv4, $parm_ipv6, $parm_ipv6_stripped);
my $parm_hostname;
+# Convenience for regex'
+# for tighter, see https://metacpan.org/dist/IO-Socket-IP/source/lib/IO/Socket/IP.pm#L37
+my $re_ipv4 = qr/\d{1,3}(?:\.\d{1,3}){3}/;
+my $re_6g = qr/[[:xdigit:]]{1,4}/;
+my $re_6s = qr/${re_6g}:/;
+my $re_ipv6 = qr/${re_6s}{0,7}${re_6g}(?:::${re_6s}{0,5}${re_6g})?/;
+my $re_ip = qr/(?:${re_ipv4}|${re_ipv6})/;
+
###############################################################################
###############################################################################
s/\d\d-\w\w\w-\d\d\d\d\s\d\d:\d\d:\d\d\s[-+]\d\d\d\d,/06-Sep-1999 15:52:48 +0100,/gx;
# Dates/times in debugging output for writing retry records
- if (/^ first failed=(\d+) last try=(\d+) next try=(\d+) (.*)$/)
+ if (/^(\s+)first failed=(\d+) last try=(\d+) next try=(\d+) (.*)$/)
{
- my($next) = $3 - $2;
- $_ = " first failed=dddd last try=dddd next try=+$next $4\n";
+ my($next) = $4 - $3;
+ $_ = "$1first failed=dddd last try=dddd next try=+$next $5\n";
}
s/^(\s*)now=\d+ first_failed=\d+ next_try=\d+ expired=(\w)/$1now=tttt first_failed=tttt next_try=tttt expired=$2/;
s/^(\s*)received_time=\d+ diff=\d+ timeout=(\d+)/$1received_time=tttt diff=tttt timeout=$2/;
s/TLS error on connection \(gnutls_handshake\): Error in the pull function\./a TLS session is required but an attempt to start TLS failed/g;
# (replace old with new, hoping that old only happens in one situation)
- s/TLS error on connection to \d{1,3}(.\d{1,3}){3} \[\d{1,3}(.\d{1,3}){3}\] \(gnutls_handshake\): A TLS packet with unexpected length was received./a TLS session is required for ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4], but an attempt to start TLS failed/g;
+ s/TLS error on connection to ${re_ipv4} \[${re_ipv4}\] \(gnutls_handshake\): A TLS packet with unexpected length was received./a TLS session is required for ip4.ip4.ip4.ip4 [ip4.ip4.ip4.ip4], but an attempt to start TLS failed/g;
s/TLS error on connection from \[127.0.0.1\] \(recv\): A TLS packet with unexpected length was received./TLS error on connection from [127.0.0.1] (recv): The TLS connection was non-properly terminated./g;
# signature algorithm names
s/\(port=(\d+)/"(port=" . new_value($1, "%s", \$next_port)/e;
# This handles "connection from" and the like, when the port is given
- if (!/listening for SMTP on/ && !/Connecting to/ && !/=>/ && !/->/
- && !/\*>/&& !/==/ && !/\*\*/ && !/Connection refused/ && !/in response to/
- && !/T(?:ransport)?:/)
- {
- s/\[([a-z\d:]+|\d+(?:\.\d+){3})\]:(\d+)/"[".$1."]:".new_value($2,"%s",\$next_port)/ie;
- }
+ s/(\[${re_ip}\]:)(\d+)/$1.new_value($2,"%s",\$next_port)/ie
+ unless ( /listening for SMTP on/ || /Connecting to/
+ || /[=*-]>/ || /==/ || /\*\*/
+ || /Connection refused/ || /in response to/
+ || /T(?:ransport)?:/
+ );
# Port in host address in spool file output from -Mvh
s/^(--?host_address) (.*[:.])\d+$/$1 ${2}9999/;
s/([\s,])S=\d+\b/$1S=sss/;
s/:S\d+\b/:Ssss/;
- s/^(\s*\d+[mhd]\s+)\d+(\s+(?:[a-z0-9-]{23}|[a-z0-9-]{18}) <)/TTT sss$2/i if $is_stdout;
+ s/^(\s*\d+[mhd]\s+)\d+(\s+(?:[[:alnum:]-]{23}|[[:alnum:]-]{16}) <)/TTT sss$2/i if $is_stdout;
s/\sSIZE=\d+\b/ SIZE=ssss/;
s/\ssize=\d+\b/ size=sss/ if $is_stderr;
s/old size = \d+\b/old size = sssss/;
# remote IPv6 addrs vary
s/^(Connection request from) \[.*:.*:.*\]$/$1 \[ipv6\]/;
+ # Hints DB use of lockfiles is provider-dependent
+ s/Failed to open \K(?:DBM|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
# because they will be different in different binaries.
next if /^$time_pid?
- (?: Berkeley\ DB:\s
- | Probably\ (?:Berkeley\ DB|ndbm|GDBM)
- | Using\ tdb
+ (?: .*\sBerkeley\ DB
+ | \sProbably\ (?:Berkeley\ DB|ndbm|GDBM)
+ | \sUsing\ (?:tdb|sqlite3)
| Authenticators:
| Lookups(?:\(built-in\))?:
| Support\ for:
)
/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;
next if /^TLS: not preloading server certs$/;
# some platforms are missing the standard CA bundle file
- next if /^tls_set_watch\(\) fail on '\/usr\/lib\/ssl\/cert.pem': No such file or directory$/;
+ next if /^tls_set_watch\(\) fail on '\/usr\/(?:lib\/ssl|local\/openssl3\/etc\/pki\/tls)\/cert.pem': No such file or directory$/;
# drop lookups
next if /^$time_pid?(?: Lookups\ \(built-in\):
if (/looked up these IP addresses/);
next if /name=localhost address=::1/;
- # drop pdkim debugging header
+ # DKIM: Not all builds include
next if /^DKIM( <<<<<<<<<<<<<<<<<<<<<<<<<<<<<+|: no signatures)$/;
+ next if /try option acl_smtp_dkim$/;
# Some platforms have TIOCOUT, some do not
next if /\d+ bytes remain in socket output buffer$/;
# DISABLE_OCSP
next if /in hosts_requ(est|ire)_ocsp\? (no|yes)/;
+ # WELLKNOWN
+ next if / in wellknown_advertise_hosts\?/;
+
# SUPPORT_PROXY
next if /host in hosts_proxy\?/;
next if / in limits_advertise_hosts?\? no \(matched "!\*"\)/;
# Experimental_XCLIENT
- next if / in hosts_xclient?\? no \(option unset\)/;
+ next if / in hosts_xclient\? no \(option unset\)/;
+
+ # Experimental_WELLKNOWN
+ next if / in hosts_wellknown\? no \(option unset\)/;
# TCP Fast Open
next if /^(ppppp )?setsockopt FASTOPEN: Network Error/;
|connection\ attempt\ to\ [^,]+,\ 0\ data) # MacOS & no-support
$/x)
{
+ $_ = <IN>;
if (/^connected$/)
{
$_ .= <IN>;
sub check_running_dovecot
{
-system('dovecot --version >/dev/null');
+system('dovecot --version >/dev/null 2>&1');
if ($? == 0)
{
print "Dovecot appears to be available\n";
}
elsif (/^Support for: (.*)/)
- {
+ { # Compile-time features - exim -bV
print;
@temp = split /(\s+)/, $1;
push(@temp, ' ');
if (!defined $parm_malware{$1}) { $wantthis = 0; last; }
}
elsif (/^(not )?feature (.*)$/)
- {
+ { #a macro name, or lack thereof - -bP macros
# move to a subroutine?
my $eximinfo = "$parm_exim -C $parm_cwd/test-config -DDIR=$parm_cwd -bP macro $2";