diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/README | 10 | ||||
-rw-r--r-- | test/confs/0551 | 36 | ||||
-rw-r--r-- | test/log/0551 | 11 | ||||
-rw-r--r-- | test/mail/0551.userx | 31 | ||||
-rw-r--r-- | test/mail/0551.usery | 10 | ||||
-rw-r--r-- | test/mail/0551.userz | 10 | ||||
-rwxr-xr-x | test/runtest | 47 | ||||
-rw-r--r-- | test/scripts/0000-Basic/0551 | 14 | ||||
-rw-r--r-- | test/stdout/0551 | 26 |
9 files changed, 192 insertions, 3 deletions
diff --git a/test/README b/test/README index e1f8048f7..5c060974c 100644 --- a/test/README +++ b/test/README @@ -1,4 +1,4 @@ -$Cambridge: exim/test/README,v 1.6 2007/01/23 11:01:10 ph10 Exp $ +$Cambridge: exim/test/README,v 1.7 2007/01/31 16:52:12 ph10 Exp $ EXPORTABLE EXIM TEST SUITE -------------------------- @@ -6,7 +6,7 @@ EXPORTABLE EXIM TEST SUITE This document last updated for: Test Suite Version: 4.67 -Date: 23 January 2007 +Date: 31 January 2007 BACKGROUND @@ -637,6 +637,12 @@ The file remains locked with the following command (normally exim) is obeyed. This command runs the exinext utility with the given argument data. + exigrep <data> + +This command runs the exigrep utility with the given data (the search pattern) +on the current mainlog file. + + gnutls This command is present at the start of all but one of the tests that use diff --git a/test/confs/0551 b/test/confs/0551 new file mode 100644 index 000000000..cecaae490 --- /dev/null +++ b/test/confs/0551 @@ -0,0 +1,36 @@ +# Exim test configuration 0551 + +LS=+pid + +exim_path = EXIM_PATH +host_lookup_order = bydns +primary_hostname = myhost.test.ex +rfc1413_query_timeout = 0s +spool_directory = DIR/spool +log_file_path = DIR/spool/log/%slog +gecos_pattern = "" +gecos_name = CALLER_NAME + +# ----- Main settings ----- + +log_selector = LS + +# ----- Routers ----- + +begin routers + +r1: + driver = accept + transport = t1 + + +# ----- Transports ----- + +begin transports + +t1: + driver = appendfile + user = CALLER + file = DIR/test-mail/$local_part + +# End diff --git a/test/log/0551 b/test/log/0551 new file mode 100644 index 000000000..831e11a89 --- /dev/null +++ b/test/log/0551 @@ -0,0 +1,11 @@ +1999-03-02 09:44:33 [1234] 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 => usery <usery@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 [1236] 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 => userz <userz@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 Completed +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed diff --git a/test/mail/0551.userx b/test/mail/0551.userx new file mode 100644 index 000000000..01ca394c0 --- /dev/null +++ b/test/mail/0551.userx @@ -0,0 +1,31 @@ +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaX-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaX-0005vi-00@myhost.test.ex> +From: CALLER_NAME <CALLER@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Message 1 + +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaY-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaY-0005vi-00@myhost.test.ex> +From: CALLER_NAME <CALLER@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Message 2 + +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaZ-0005vi-00 + for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaZ-0005vi-00@myhost.test.ex> +From: CALLER_NAME <CALLER@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Message 3 + diff --git a/test/mail/0551.usery b/test/mail/0551.usery new file mode 100644 index 000000000..e4d855b81 --- /dev/null +++ b/test/mail/0551.usery @@ -0,0 +1,10 @@ +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaX-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaX-0005vi-00@myhost.test.ex> +From: CALLER_NAME <CALLER@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Message 1 + diff --git a/test/mail/0551.userz b/test/mail/0551.userz new file mode 100644 index 000000000..29b2f0da7 --- /dev/null +++ b/test/mail/0551.userz @@ -0,0 +1,10 @@ +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER by myhost.test.ex with local (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaY-0005vi-00; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: <E10HmaY-0005vi-00@myhost.test.ex> +From: CALLER_NAME <CALLER@myhost.test.ex> +Date: Tue, 2 Mar 1999 09:44:33 +0000 + +Message 2 + diff --git a/test/runtest b/test/runtest index 0d5b10504..328b89958 100755 --- a/test/runtest +++ b/test/runtest @@ -1,6 +1,6 @@ #! /usr/bin/perl -w -# $Cambridge: exim/test/runtest,v 1.22 2007/01/23 14:57:51 ph10 Exp $ +# $Cambridge: exim/test/runtest,v 1.23 2007/01/31 16:52:12 ph10 Exp $ ############################################################################### # This is the controlling script for the "new" test suite for Exim. It should # @@ -432,6 +432,10 @@ while(<IN>) # Time on queue tolerance s/QT=1s/QT=0s/; + # Eximstats heading + s/Exim\sstatistics\sfrom\s\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d\sto\s + \d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d/Exim statistics from <time> to <time>/x; + # ======== Caller's login, uid, gid, home ======== @@ -497,6 +501,10 @@ while(<IN>) # Pid in temp file in appendfile transport s"test-mail/temp\.\d+\."test-mail/temp.pppp."; + # Optional pid in log lines + s/^(\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d)(\s[+-]\d\d\d\d|)(\s\[\d+\])/ + "$1$2 [" . new_value($3, "%s", \$next_pid) . "]"/gxe; + # Detect a daemon stderr line with a pid and save the pid for subsequent # removal from following lines. $spid = $1 if /^(\s*\d+) (?:listening|LOG: MAIN|(?:daemon_smtp_port|local_interfaces) overridden by)/; @@ -590,6 +598,8 @@ while(<IN>) s/\+0100,\d+;/+0100,ddd;/; s/\(\d+ bytes written\)/(ddd bytes written)/; s/added '\d+ 1'/added 'ddd 1'/; + s/Received\s+\d+/Received nnn/; + s/Delivered\s+\d+/Delivered nnn/; # ======== Values in spool space failure message ======== @@ -1413,6 +1423,30 @@ if (/^exinext\s+(.*)/) } +# The "exigrep" command runs exigrep on the current mainlog + +if (/^exigrep\s+(.*)/) + { + run_system("(./eximdir/exigrep " . + "$1 $parm_cwd/spool/log/mainlog;" . + "echo exigrep exit code = \$?)" . + ">>test-stdout"); + return 1; + } + + +# The "eximstats" command runs eximstats on the current mainlog + +if (/^eximstats\s+(.*)/) + { + run_system("(./eximdir/eximstats " . + "$1 $parm_cwd/spool/log/mainlog;" . + "echo eximstats exit code = \$?)" . + ">>test-stdout"); + return 1; + } + + # The "gnutls" command makes a copy of saved GnuTLS parameter data in the # spool directory, to save Exim from re-creating it each time. @@ -2535,6 +2569,16 @@ if (system("cp $parm_exim_dir/exinext eximdir") != 0) tests_exit(-1, "Failed to make a copy of exinext: $!"); } +if (system("cp $parm_exim_dir/exigrep eximdir") != 0) + { + tests_exit(-1, "Failed to make a copy of exigrep: $!"); + } + +if (system("cp $parm_exim_dir/eximstats eximdir") != 0) + { + tests_exit(-1, "Failed to make a copy of eximstats: $!"); + } + ################################################## # Check that the Exim user can access stuff # @@ -2904,6 +2948,7 @@ foreach $test (@test_list) undef %cache; $next_msgid = "aX"; + $next_pid = 1234; $next_port = 1111; $message_skip = 0; $msglog_skip = 0; diff --git a/test/scripts/0000-Basic/0551 b/test/scripts/0000-Basic/0551 new file mode 100644 index 000000000..afd5c9b05 --- /dev/null +++ b/test/scripts/0000-Basic/0551 @@ -0,0 +1,14 @@ +# log_selector = +pid +# +exim -odi userx@test.ex usery@test.ex +Message 1 +**** +exim -odi userx@test.ex userz@test.ex +Message 2 +**** +exim -DLS= -odi userx@test.ex +Message 3 +**** +exigrep userx +eximstats -ne -nr -nt -tnl -q0 -h0 -t0 +no_msglog_check diff --git a/test/stdout/0551 b/test/stdout/0551 new file mode 100644 index 000000000..8af281557 --- /dev/null +++ b/test/stdout/0551 @@ -0,0 +1,26 @@ +1999-03-02 09:44:33 [1234] 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 => usery <usery@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1235] 10HmaX-0005vi-00 Completed + +1999-03-02 09:44:33 [1236] 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 => userz <userz@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 [1237] 10HmaY-0005vi-00 Completed + +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss +1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed + +exigrep exit code = 0 + +Exim statistics from <time> to <time> + +Grand total summary +------------------- + At least one address + TOTAL Volume Messages Addresses Hosts Delayed Failed + Received nnn 3 1 0 0.0% 0 0.0% + Delivered nnn 5 5 1 + +eximstats exit code = 0 |