masqmail-0.2

changeset 64:0379789a847b

improved comments in test cases
author meillo@marmaro.de
date Sun, 30 May 2010 16:52:35 +0200
parents 49ca781e1503
children 66d47cc69611
files tests/README tests/hostname-stdin/test.conf.tpl tests/hostname-stdin/test.tpl tests/localhost-stdin/makefile tests/localhost-stdin/test tests/localhost-stdin/test.conf.tpl tests/relay-to-hostname-mta/test.conf.tpl tests/relay-to-hostname-mta/test.tpl tests/relay-to-localhost-mta/test.conf.tpl tests/relay-to-localhost-mta/test.tpl
diffstat 10 files changed, 81 insertions(+), 107 deletions(-) [+]
line diff
     1.1 --- a/tests/README	Sun May 30 16:05:49 2010 +0200
     1.2 +++ b/tests/README	Sun May 30 16:52:35 2010 +0200
     1.3 @@ -27,3 +27,7 @@
     1.4  programs, the configuration file or masqmail itself. If you have
     1.5  installed masqmail successfully and these scripts do not work, do not
     1.6  worry too much :-).
     1.7 +
     1.8 +
     1.9 +The original test scripts are by oku.
    1.10 +They were rearranged and extended by meillo.
     2.1 --- a/tests/hostname-stdin/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
     2.2 +++ b/tests/hostname-stdin/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
     2.3 @@ -1,39 +1,28 @@
     2.4 -# Example configuration for MasqMail
     2.5 -# Copyright (C) 1999 Oliver Kurth
     2.6 -
     2.7 -
     2.8 -# this is just for testing. In real life it does not make much sense:
     2.9 +# running as user is enough for testing purposes
    2.10  run_as_user=true
    2.11  
    2.12  # set debug level (0 = no debugging, 5 = very much, 6 = too much)
    2.13 -# can also be set with the -d option on the cmd line
    2.14  debug_level = 5
    2.15  
    2.16 +# deliver at once
    2.17  do_queue = false
    2.18  
    2.19 -# The name with which MasqMail identifies itself to others:
    2.20 +#
    2.21  host_name="SMTP_HOST"
    2.22  
    2.23 -# Hosts considered local:
    2.24 +# we want to deliver a message to `hostname`
    2.25  local_hosts="SMTP_HOST"
    2.26  
    2.27 -# Nets considered local, for immediate delivery attempts:
    2.28 -# ALL hosts not included in either local_host or local_nets are
    2.29 -# considered to be 'outside', meaning that messages to them will be queued
    2.30 -#local_nets="SMTP_HOST"
    2.31 -
    2.32 -# accept connections on these interfaces:
    2.33 -#listen_addresses="localhost:2525"
    2.34 -
    2.35 -# where MasqMail stores its spool files and other stuff:
    2.36 -#spool_dir="/var/spool/masqmail"
    2.37 +# spool into the current directory
    2.38  spool_dir="PWD"
    2.39  
    2.40 -# where local mail will be written to:
    2.41 +# deliver local mail into the current directory
    2.42  mail_dir="PWD"
    2.43  
    2.44 -# use syslogd for logs?
    2.45 +# log into the current directory
    2.46  use_syslog=false
    2.47 +log_dir="PWD"
    2.48  
    2.49 -# directory for log files if not using syslogd:
    2.50 -log_dir="PWD"
    2.51 +# relative names to the warn/failure template files
    2.52 +errmsg_file="PWD/../../tpl/failmsg.tpl"
    2.53 +warnmsg_file="PWD/../../tpl/warnmsg.tpl"
     3.1 --- a/tests/hostname-stdin/test.tpl	Sun May 30 16:05:49 2010 +0200
     3.2 +++ b/tests/hostname-stdin/test.tpl	Sun May 30 16:52:35 2010 +0200
     3.3 @@ -1,12 +1,12 @@
     3.4 -#! /bin/bash
     3.5 +#!/bin/sh
     3.6  
     3.7 -# should be run from within tests dir set if you move this:
     3.8 +# path to the masqmail executable
     3.9  mm_bin=../../src/masqmail
    3.10  
    3.11  hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
    3.12  hto="$hfrom"
    3.13  to=`logname`@RECV_HOST
    3.14 -hsubject="MasqMail stdin Test"
    3.15 +hsubject="Masqmail test: `basename pwd`"
    3.16  
    3.17  
    3.18  # Testing with rcpt on cmd line
    3.19 @@ -21,7 +21,6 @@
    3.20  Subject: $hsubject
    3.21  
    3.22  Hallo Fritz!
    3.23 -
    3.24  ..
    3.25  there is a dot above (Yes, one and not two).
    3.26  
    3.27 @@ -32,7 +31,7 @@
    3.28  
    3.29  EOF
    3.30  
    3.31 -#
    3.32 +
    3.33  # Testing with rcpt on cmd line with -oi option
    3.34  # (dot does not end)
    3.35  #
    3.36 @@ -54,7 +53,7 @@
    3.37  
    3.38  EOF
    3.39  
    3.40 -#
    3.41 +
    3.42  # Testing with rcpt read from headers (-t option)
    3.43  # (dot does end)
    3.44  #
     4.1 --- a/tests/localhost-stdin/makefile	Sun May 30 16:05:49 2010 +0200
     4.2 +++ b/tests/localhost-stdin/makefile	Sun May 30 16:52:35 2010 +0200
     4.3 @@ -6,7 +6,7 @@
     4.4  
     4.5  test.conf: test.conf.tpl
     4.6  	# fails if the current path contains `^'.
     4.7 -	sed "s^PWD^`pwd`^" $< >$@
     4.8 +	sed "s/SMTP_HOST/`hostname`/; s^PWD^`pwd`^" $< >$@
     4.9  
    4.10  clean:
    4.11  	rm -f test.conf
     5.1 --- a/tests/localhost-stdin/test	Sun May 30 16:05:49 2010 +0200
     5.2 +++ b/tests/localhost-stdin/test	Sun May 30 16:52:35 2010 +0200
     5.3 @@ -1,15 +1,15 @@
     5.4 -#! /bin/bash
     5.5 +#!/bin/sh
     5.6  
     5.7 -# should be run from within tests dir set if you move this:
     5.8 +# path to the masqmail executable
     5.9  mm_bin=../../src/masqmail
    5.10  
    5.11 -#
    5.12 +
    5.13  hfrom="\"Fritz Meier\" <`logname`@localhost>"
    5.14  hto=$hfrom
    5.15  to=`logname`@localhost
    5.16 -hsubject="MasqMail stdin Test"
    5.17 +hsubject="Masqmail test: localhost-stdin"
    5.18  
    5.19 -#
    5.20 +
    5.21  # Testing with rcpt on cmd line
    5.22  # (dot does end)
    5.23  #
    5.24 @@ -22,7 +22,6 @@
    5.25  Subject: $hsubject
    5.26  
    5.27  Hallo Fritz!
    5.28 -
    5.29  ..
    5.30  there is a dot above (Yes, one and not two).
    5.31  
    5.32 @@ -33,7 +32,7 @@
    5.33  
    5.34  EOF
    5.35  
    5.36 -#
    5.37 +
    5.38  # Testing with rcpt on cmd line with -oi option
    5.39  # (dot does not end)
    5.40  #
    5.41 @@ -55,7 +54,7 @@
    5.42  
    5.43  EOF
    5.44  
    5.45 -#
    5.46 +
    5.47  # Testing with rcpt read from headers (-t option)
    5.48  # (dot does end)
    5.49  #
     6.1 --- a/tests/localhost-stdin/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
     6.2 +++ b/tests/localhost-stdin/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
     6.3 @@ -1,45 +1,28 @@
     6.4 -# Example configuration for MasqMail
     6.5 -# Copyright (C) 1999 Oliver Kurth
     6.6 -
     6.7 -
     6.8 -# this is just for testing. In real life it does not make much sense:
     6.9 +# running as user is enough for testing purposes
    6.10  run_as_user=true
    6.11  
    6.12  # set debug level (0 = no debugging, 5 = very much, 6 = too much)
    6.13 -# can also be set with the -d option on the cmd line
    6.14  debug_level = 5
    6.15  
    6.16 +# deliver at once
    6.17  do_queue = false
    6.18  
    6.19 -# The name with which MasqMail identifies itself to others:
    6.20 +#
    6.21  host_name="SMTP_HOST"
    6.22  
    6.23 -# Hosts considered local:
    6.24 -#local_hosts="localhost;blue.patchwork.net;blue"
    6.25 +# we want to deliver a message to localhost
    6.26  local_hosts="localhost"
    6.27  
    6.28 -# Nets considered local, for immediate delivery attempts:
    6.29 -# ALL hosts not included in either local_host or local_nets are
    6.30 -# considered to be 'outside', meaning that messages to them will be queued
    6.31 -#local_nets="SMTP_HOST"
    6.32 -
    6.33 -# accept connections on these interfaces:
    6.34 -#listen_addresses="localhost:2525"
    6.35 -
    6.36 -# send messages to this port:
    6.37 -# probably this will also be configurable on host basis
    6.38 -#remote_port=25
    6.39 -
    6.40 -# where MasqMail stores its spool files and other stuff:
    6.41 -#spool_dir="/var/spool/masqmail"
    6.42 +# spool dir is the current directory
    6.43  spool_dir="PWD"
    6.44  
    6.45 -# where local mail will be written to:
    6.46 -#mail_dir="/var/spool/mail"
    6.47 +# deliver local mail into the current directory
    6.48  mail_dir="PWD"
    6.49  
    6.50 -# use syslogd for logs?
    6.51 +# log into the current directory
    6.52  use_syslog=false
    6.53 +log_dir="PWD"
    6.54  
    6.55 -# directory for log files if not using syslogd:
    6.56 -log_dir="PWD"
    6.57 +# relative paths to warn/failure message templates
    6.58 +errmsg_file="PWD/../../tpl/failmsg.tpl"
    6.59 +warnmsg_file="PWD/../../tpl/warnmsg.tpl"
     7.1 --- a/tests/relay-to-hostname-mta/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
     7.2 +++ b/tests/relay-to-hostname-mta/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
     7.3 @@ -1,33 +1,34 @@
     7.4 -
     7.5 -# this is just for testing. In real life it does not make much sense:
     7.6 +# running as user is enough for testing purposes
     7.7  run_as_user=true
     7.8  
     7.9  # set debug level (0 = no debugging, 5 = very much, 6 = too much)
    7.10 -# can also be set with the -d option on the cmd line
    7.11  debug_level = 5
    7.12  
    7.13 +# deliver at once
    7.14  do_queue = false
    7.15  
    7.16 -# The name with which MasqMail identifies itself to others:
    7.17 +# identify with some name that is *not* the one of the our machine
    7.18 +# maybe we should not define a name at all, but this may lead to
    7.19 +# problems. Could be we even need a FQDN here.
    7.20  host_name="MASQMAIL-TEST"
    7.21  
    7.22 -# where MasqMail stores its spool files and other stuff:
    7.23 +# we want to deliver through a route named `test' to a local MTA
    7.24 +# thus we do not define any hosts or nets as local
    7.25 +# all mail should go through the `test' route.
    7.26 +online_detect = "file"
    7.27 +online_file = "PWD/online"
    7.28 +online_routes.test = "PWD/test.route"
    7.29 +
    7.30 +# spool files in the current directory
    7.31  spool_dir="PWD"
    7.32  
    7.33 -# where local mail will be written to:
    7.34 +# deliver local mails into the current directory
    7.35  mail_dir="PWD"
    7.36  
    7.37 -# use syslogd for logs?
    7.38 +# log into the current directory
    7.39  use_syslog=false
    7.40 -
    7.41 -# directory for log files if not using syslogd:
    7.42  log_dir="PWD"
    7.43  
    7.44 -online_routes.test = "PWD/test.route"
    7.45 -
    7.46 +# relative paths to the warn/failure message templates
    7.47  errmsg_file="PWD/../../tpl/failmsg.tpl"
    7.48  warnmsg_file="PWD/../../tpl/warnmsg.tpl"
    7.49 -
    7.50 -online_detect = "file"
    7.51 -online_file = "PWD/online"
    7.52 -
     8.1 --- a/tests/relay-to-hostname-mta/test.tpl	Sun May 30 16:05:49 2010 +0200
     8.2 +++ b/tests/relay-to-hostname-mta/test.tpl	Sun May 30 16:52:35 2010 +0200
     8.3 @@ -1,12 +1,12 @@
     8.4 -#! /bin/bash
     8.5 +#!/bin/sh
     8.6  
     8.7 -# should be run from within tests dir set if you move this:
     8.8 +# path to the masqmail executable
     8.9  mm_bin=../../src/masqmail
    8.10  
    8.11  hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
    8.12  hto="$hfrom"
    8.13  to=`logname`@RECV_HOST
    8.14 -hsubject="MasqMail stdin Test"
    8.15 +hsubject="Masqmail test: relay-to-hostname-mta"
    8.16  
    8.17  
    8.18  # Testing with rcpt on cmd line
    8.19 @@ -21,7 +21,6 @@
    8.20  Subject: $hsubject
    8.21  
    8.22  Hallo Fritz!
    8.23 -
    8.24  ..
    8.25  there is a dot above (Yes, one and not two).
    8.26  
    8.27 @@ -32,7 +31,7 @@
    8.28  
    8.29  EOF
    8.30  
    8.31 -#
    8.32 +
    8.33  # Testing with rcpt on cmd line with -oi option
    8.34  # (dot does not end)
    8.35  #
    8.36 @@ -54,7 +53,7 @@
    8.37  
    8.38  EOF
    8.39  
    8.40 -#
    8.41 +
    8.42  # Testing with rcpt read from headers (-t option)
    8.43  # (dot does end)
    8.44  #
     9.1 --- a/tests/relay-to-localhost-mta/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
     9.2 +++ b/tests/relay-to-localhost-mta/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
     9.3 @@ -1,33 +1,34 @@
     9.4 -
     9.5 -# this is just for testing. In real life it does not make much sense:
     9.6 +# running as user is enough for testing purposes
     9.7  run_as_user=true
     9.8  
     9.9  # set debug level (0 = no debugging, 5 = very much, 6 = too much)
    9.10 -# can also be set with the -d option on the cmd line
    9.11  debug_level = 5
    9.12  
    9.13 +# deliver at once
    9.14  do_queue = false
    9.15  
    9.16 -# The name with which MasqMail identifies itself to others:
    9.17 +# identify with some name that is *not* the one of the our machine
    9.18 +# maybe we should not define a name at all, but this may lead to
    9.19 +# problems. Could be we even need a FQDN here.
    9.20  host_name="MASQMAIL-TEST"
    9.21  
    9.22 -# where MasqMail stores its spool files and other stuff:
    9.23 +# we want to deliver through a route named `test' to a local MTA
    9.24 +# thus we do not define any hosts or nets as local
    9.25 +# all mail should go through the `test' route.
    9.26 +online_detect = "file"
    9.27 +online_file = "PWD/online"
    9.28 +online_routes.test = "PWD/test.route"
    9.29 +
    9.30 +# spool files in the current directory
    9.31  spool_dir="PWD"
    9.32  
    9.33 -# where local mail will be written to:
    9.34 +# deliver local mails into the current directory
    9.35  mail_dir="PWD"
    9.36  
    9.37 -# use syslogd for logs?
    9.38 +# log into the current directory
    9.39  use_syslog=false
    9.40 -
    9.41 -# directory for log files if not using syslogd:
    9.42  log_dir="PWD"
    9.43  
    9.44 -online_routes.test = "PWD/test.route"
    9.45 -
    9.46 +# relative paths to the warn/failure message templates
    9.47  errmsg_file="PWD/../../tpl/failmsg.tpl"
    9.48  warnmsg_file="PWD/../../tpl/warnmsg.tpl"
    9.49 -
    9.50 -online_detect = "file"
    9.51 -online_file = "PWD/online"
    9.52 -
    10.1 --- a/tests/relay-to-localhost-mta/test.tpl	Sun May 30 16:05:49 2010 +0200
    10.2 +++ b/tests/relay-to-localhost-mta/test.tpl	Sun May 30 16:52:35 2010 +0200
    10.3 @@ -1,12 +1,12 @@
    10.4 -#! /bin/bash
    10.5 +#!/bin/sh
    10.6  
    10.7 -# should be run from within tests dir set if you move this:
    10.8 +# path to the masqmail executable
    10.9  mm_bin=../../src/masqmail
   10.10  
   10.11  hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
   10.12  hto="$hfrom"
   10.13  to=`logname`@RECV_HOST
   10.14 -hsubject="MasqMail stdin Test"
   10.15 +hsubject="Masqmail test: relay-to-localhost-mta"
   10.16  
   10.17  
   10.18  # Testing with rcpt on cmd line
   10.19 @@ -21,7 +21,6 @@
   10.20  Subject: $hsubject
   10.21  
   10.22  Hallo Fritz!
   10.23 -
   10.24  ..
   10.25  there is a dot above (Yes, one and not two).
   10.26  
   10.27 @@ -32,7 +31,7 @@
   10.28  
   10.29  EOF
   10.30  
   10.31 -#
   10.32 +
   10.33  # Testing with rcpt on cmd line with -oi option
   10.34  # (dot does not end)
   10.35  #
   10.36 @@ -54,7 +53,7 @@
   10.37  
   10.38  EOF
   10.39  
   10.40 -#
   10.41 +
   10.42  # Testing with rcpt read from headers (-t option)
   10.43  # (dot does end)
   10.44  #