X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=test%2Fruntest;h=ca3124729de7eaa7aab7ca8c9a31fb3d5d26e7f5;hp=7af30763b86e5f48e86ce6c0b5d1e320971fbb93;hb=d36e39d7a785f12c138c60d6b58bf62161c4eca1;hpb=d658adda50d19b00d2242c0f9162ab510ecda799 diff --git a/test/runtest b/test/runtest index 7af30763b..ca3124729 100755 --- a/test/runtest +++ b/test/runtest @@ -14,6 +14,7 @@ ############################################################################### #use strict; +#use 5.010; use Errno; use FileHandle; use Socket; @@ -38,6 +39,7 @@ $gnutls_dh_bits_normal = 2236; $cf = "bin/cf -exact"; $cr = "\r"; $debug = 0; +$flavour = 'FOO'; $force_continue = 0; $force_update = 0; $log_failed_filename = "failed-summary.log"; @@ -45,7 +47,7 @@ $more = "less -XF"; $optargs = ""; $save_output = 0; $server_opts = ""; -$flavour = 'FOO'; +$valgrind = 0; $have_ipv4 = 1; $have_ipv6 = 1; @@ -81,13 +83,16 @@ $parm_port_d3 = 1227; # Additional for daemon $parm_port_d4 = 1228; # Additional for daemon # Manually set locale -$ENV{'LC_ALL'} = 'C'; +$ENV{LC_ALL} = 'C'; # In some environments USER does not exists, but we # need it for some test(s) $ENV{USER} = getpwuid($>) if not exists $ENV{USER}; +my ($parm_configure_owner, $parm_configure_group); +my ($parm_ipv4, $parm_ipv6); +my $parm_hostname; ############################################################################### ############################################################################### @@ -348,7 +353,7 @@ $spid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; # that are specific to certain file types, though there are also some of those # inline too. -while() +LINE: while() { RESET_AFTER_EXTRA_LINE_READ: # Custom munges @@ -426,7 +431,7 @@ RESET_AFTER_EXTRA_LINE_READ: # File descriptor numbers may vary s/^writing data block fd=\d+/writing data block fd=dddd/; - s/running as transport filter: write=\d+ read=\d+/running as transport filter: write=dddd read=dddd/; + s/(running as transport filter:) fd_write=\d+ fd_read=\d+/$1 fd_write=dddd fd_read=dddd/; # ======== Dumpdb output ======== @@ -652,6 +657,9 @@ RESET_AFTER_EXTRA_LINE_READ: s/waiting for children of \d+/waiting for children of pppp/; s/waiting for (\S+) \(\d+\)/waiting for $1 (pppp)/; + # The spool header file name varies with PID + s%^(Writing spool header file: .*/hdr).[0-9]{1,5}%$1.pppp%; + # ======== Port numbers ======== # Incoming port numbers may vary, but not in daemon startup line. @@ -771,6 +779,7 @@ RESET_AFTER_EXTRA_LINE_READ: # different wording in the error messages, so we cannot compare them. s/(TLS error on connection (?:from .* )?\(SSL_\w+\): error:)(.*)/$1 <>/; + next if /SSL verify error: depth=0 error=certificate not trusted/; # ======== Maildir things ======== # timestamp output in maildir processing @@ -857,6 +866,11 @@ RESET_AFTER_EXTRA_LINE_READ: next if /^SSL info: unknown state/; next if /^SSL info: SSLv2\/v3 write client hello A/; next if /^SSL info: SSLv3 read server key exchange A/; + next if /SSL verify error: depth=0 error=certificate not trusted/; + s/SSL3_READ_BYTES/ssl3_read_bytes/; + + # gnutls version variances + next if /^Error in the pull function./; } # ======== stderr ======== @@ -952,7 +966,7 @@ RESET_AFTER_EXTRA_LINE_READ: # are unset, because tls ain't always there. next if /in\s(?:tls_advertise_hosts\?|hosts_require_tls\?) - \sno\s\(option\sunset\)/x; + \sno\s\((option\sunset|end\sof\slist)\)/x; # Skip auxiliary group lists because they will vary. @@ -997,6 +1011,29 @@ RESET_AFTER_EXTRA_LINE_READ: while () { last if !/^\s/; } } + # remote port numbers vary + s/(Connection request from 127.0.0.1 port) \d{1,5}/$1 sssss/; + + # 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; + + # SUPPORT_PROXY + next if /host in hosts_proxy\?/; + + # Experimental_International + next if / in smtputf8_advertise_hosts\? no \(option unset\)/; + + # 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/; + # 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 @@ -1018,17 +1055,6 @@ RESET_AFTER_EXTRA_LINE_READ: @saved = (); } - # remote port numbers vary - s/(Connection request from 127.0.0.1 port) \d{1,5}/$1 sssss/; - - # 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; - - # Experimental_International - next if / in smtputf8_advertise_hosts\? no \(option unset\)/; - # Skip some lines that Exim puts out at the start of debugging output # because they will be different in different binaries. @@ -1043,6 +1069,7 @@ RESET_AFTER_EXTRA_LINE_READ: /^log selectors =/ || /^cwd=/ || /^Fixed never_users:/ || + /^Configure owner:/ || /^Size of off_t:/ ); @@ -1382,8 +1409,29 @@ $munges = 'optional_dsn_info' => { 'mail' => '/^(X-(Remote-MTA-(smtp-greeting|helo-response)|Exim-Diagnostic|(body|message)-linecount):|Remote-MTA: X-ip;)/' - } - + }, + + 'optional_config' => + { 'stdout' => '/^( + dkim_(canon|domain|private_key|selector|sign_headers|strict) + |gnutls_require_(kx|mac|protocols) + |hosts_(requ(est|ire)|try)_(dane|ocsp) + |hosts_(avoid|nopass|require|verify_avoid)_tls + |socks_proxy + |tls_[^ ]* + )($|[ ]=)/x' }, + + 'sys_bindir' => + { 'mainlog' => 's%/(usr/)?bin/%SYSBINDIR/%' }, + + 'sync_check_data' => + { 'mainlog' => 's/^(.* SMTP protocol synchronization error .* next input=.{8}).*$/$1/', + 'rejectlog' => 's/^(.* SMTP protocol synchronization error .* next input=.{8}).*$/$1/'}, + + 'debuglog_stdout' => + { 'stdout' => 's/^\d\d:\d\d:\d\d\s+\d+ //; + s/Process \d+ is ready for new message/Process pppp is ready for new message/' + }, }; @@ -1659,6 +1707,8 @@ my($commandnameref) = $_[3]; my($aux_info) = $_[4]; my($yield) = 1; +our %ENV = map { $_ => $ENV{$_} } grep { /^(?:USER|SHELL|PATH|TERM|EXIM_TEST_.*)$/ } keys %ENV; + if (/^(\d+)\s*$/) # Handle unusual return code { my($r) = $_[2]; @@ -1924,7 +1974,7 @@ if (/^sleep\s+(.*)$/) # Various Unix management commands are recognized if (/^(ln|ls|du|mkdir|mkfifo|touch|cp|cat)\s/ || - /^sudo (rmdir|rm|chown|chmod)\s/) + /^sudo\s(rmdir|rm|mv|chown|chmod)\s/) { run_system("$_ >>test-stdout 2>>test-stderr"); return 1; @@ -1945,6 +1995,7 @@ if (/^(ln|ls|du|mkdir|mkfifo|touch|cp|cat)\s/ || # command, triggered by $server_pid being non-zero. The server sends its output # to a different file. The variable $server_opts, if not empty, contains # options to disable IPv4 or IPv6 if necessary. +# This works because "server" swallows its stdin before waiting for a connection. if (/^server\s+(.*)$/) { @@ -2062,7 +2113,7 @@ if (/^client/ || /^(sudo\s+)?perl\b/) # not drop privilege when -C and -D options are present. To run the exim # command as root, we use sudo. -elsif (/^([A-Z_]+=\S+\s+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.*)$/) +elsif (/^((?i:[A-Z\d_]+=\S+\s+)+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.*)$/) { $args = $6; my($envset) = (defined $1)? $1 : ""; @@ -2123,7 +2174,10 @@ elsif (/^([A-Z_]+=\S+\s+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.* $args =~ s/(?:^|\s)-d\S*// if $optargs =~ /(?:^|\s)-d/; - $cmd = "$envset$sudo$parm_cwd/eximdir/exim$special$optargs " . + my $opt_valgrind = $valgrind ? "valgrind --leak-check=yes --suppressions=$parm_cwd/aux-fixed/valgrind.supp " : ""; + + $cmd = "$envset$sudo$opt_valgrind" . + "$parm_cwd/eximdir/exim$special$optargs " . "-DEXIM_PATH=$parm_cwd/eximdir/exim$special " . "-C $parm_cwd/test-config $args " . ">>test-stdout 2>>test-stderr"; @@ -2204,6 +2258,45 @@ elsif (/^([A-Z_]+=\S+\s+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+)?\s+(.* } } +# The "background" command is run but not waited-for, like exim -DSERVER=server. +# One script line is read and fork-exec'd. The PID is stored for a later +# killdaemon. + +elsif (/^background$/) + { + my $line; +# $pidfile = "$parm_cwd/aux-var/server-daemon.pid"; + + $_ =