changeset 64:0379789a847b

improved comments in test cases
author meillo@marmaro.de
date Sun, 30 May 2010 16:52:35 +0200 (2010-05-30)
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 wrap: on
line diff
--- a/tests/README	Sun May 30 16:05:49 2010 +0200
+++ b/tests/README	Sun May 30 16:52:35 2010 +0200
@@ -27,3 +27,7 @@
 programs, the configuration file or masqmail itself. If you have
 installed masqmail successfully and these scripts do not work, do not
 worry too much :-).
+
+
+The original test scripts are by oku.
+They were rearranged and extended by meillo.
--- a/tests/hostname-stdin/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/hostname-stdin/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,39 +1,28 @@
-# Example configuration for MasqMail
-# Copyright (C) 1999 Oliver Kurth
-
-
-# this is just for testing. In real life it does not make much sense:
+# running as user is enough for testing purposes
 run_as_user=true
 
 # set debug level (0 = no debugging, 5 = very much, 6 = too much)
-# can also be set with the -d option on the cmd line
 debug_level = 5
 
+# deliver at once
 do_queue = false
 
-# The name with which MasqMail identifies itself to others:
+#
 host_name="SMTP_HOST"
 
-# Hosts considered local:
+# we want to deliver a message to `hostname`
 local_hosts="SMTP_HOST"
 
-# Nets considered local, for immediate delivery attempts:
-# ALL hosts not included in either local_host or local_nets are
-# considered to be 'outside', meaning that messages to them will be queued
-#local_nets="SMTP_HOST"
-
-# accept connections on these interfaces:
-#listen_addresses="localhost:2525"
-
-# where MasqMail stores its spool files and other stuff:
-#spool_dir="/var/spool/masqmail"
+# spool into the current directory
 spool_dir="PWD"
 
-# where local mail will be written to:
+# deliver local mail into the current directory
 mail_dir="PWD"
 
-# use syslogd for logs?
+# log into the current directory
 use_syslog=false
+log_dir="PWD"
 
-# directory for log files if not using syslogd:
-log_dir="PWD"
+# relative names to the warn/failure template files
+errmsg_file="PWD/../../tpl/failmsg.tpl"
+warnmsg_file="PWD/../../tpl/warnmsg.tpl"
--- a/tests/hostname-stdin/test.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/hostname-stdin/test.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,12 +1,12 @@
-#! /bin/bash
+#!/bin/sh
 
-# should be run from within tests dir set if you move this:
+# path to the masqmail executable
 mm_bin=../../src/masqmail
 
 hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
 hto="$hfrom"
 to=`logname`@RECV_HOST
-hsubject="MasqMail stdin Test"
+hsubject="Masqmail test: `basename pwd`"
 
 
 # Testing with rcpt on cmd line
@@ -21,7 +21,6 @@
 Subject: $hsubject
 
 Hallo Fritz!
-
 ..
 there is a dot above (Yes, one and not two).
 
@@ -32,7 +31,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt on cmd line with -oi option
 # (dot does not end)
 #
@@ -54,7 +53,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt read from headers (-t option)
 # (dot does end)
 #
--- a/tests/localhost-stdin/makefile	Sun May 30 16:05:49 2010 +0200
+++ b/tests/localhost-stdin/makefile	Sun May 30 16:52:35 2010 +0200
@@ -6,7 +6,7 @@
 
 test.conf: test.conf.tpl
 	# fails if the current path contains `^'.
-	sed "s^PWD^`pwd`^" $< >$@
+	sed "s/SMTP_HOST/`hostname`/; s^PWD^`pwd`^" $< >$@
 
 clean:
 	rm -f test.conf
--- a/tests/localhost-stdin/test	Sun May 30 16:05:49 2010 +0200
+++ b/tests/localhost-stdin/test	Sun May 30 16:52:35 2010 +0200
@@ -1,15 +1,15 @@
-#! /bin/bash
+#!/bin/sh
 
-# should be run from within tests dir set if you move this:
+# path to the masqmail executable
 mm_bin=../../src/masqmail
 
-#
+
 hfrom="\"Fritz Meier\" <`logname`@localhost>"
 hto=$hfrom
 to=`logname`@localhost
-hsubject="MasqMail stdin Test"
+hsubject="Masqmail test: localhost-stdin"
 
-#
+
 # Testing with rcpt on cmd line
 # (dot does end)
 #
@@ -22,7 +22,6 @@
 Subject: $hsubject
 
 Hallo Fritz!
-
 ..
 there is a dot above (Yes, one and not two).
 
@@ -33,7 +32,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt on cmd line with -oi option
 # (dot does not end)
 #
@@ -55,7 +54,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt read from headers (-t option)
 # (dot does end)
 #
--- a/tests/localhost-stdin/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/localhost-stdin/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,45 +1,28 @@
-# Example configuration for MasqMail
-# Copyright (C) 1999 Oliver Kurth
-
-
-# this is just for testing. In real life it does not make much sense:
+# running as user is enough for testing purposes
 run_as_user=true
 
 # set debug level (0 = no debugging, 5 = very much, 6 = too much)
-# can also be set with the -d option on the cmd line
 debug_level = 5
 
+# deliver at once
 do_queue = false
 
-# The name with which MasqMail identifies itself to others:
+#
 host_name="SMTP_HOST"
 
-# Hosts considered local:
-#local_hosts="localhost;blue.patchwork.net;blue"
+# we want to deliver a message to localhost
 local_hosts="localhost"
 
-# Nets considered local, for immediate delivery attempts:
-# ALL hosts not included in either local_host or local_nets are
-# considered to be 'outside', meaning that messages to them will be queued
-#local_nets="SMTP_HOST"
-
-# accept connections on these interfaces:
-#listen_addresses="localhost:2525"
-
-# send messages to this port:
-# probably this will also be configurable on host basis
-#remote_port=25
-
-# where MasqMail stores its spool files and other stuff:
-#spool_dir="/var/spool/masqmail"
+# spool dir is the current directory
 spool_dir="PWD"
 
-# where local mail will be written to:
-#mail_dir="/var/spool/mail"
+# deliver local mail into the current directory
 mail_dir="PWD"
 
-# use syslogd for logs?
+# log into the current directory
 use_syslog=false
+log_dir="PWD"
 
-# directory for log files if not using syslogd:
-log_dir="PWD"
+# relative paths to warn/failure message templates
+errmsg_file="PWD/../../tpl/failmsg.tpl"
+warnmsg_file="PWD/../../tpl/warnmsg.tpl"
--- a/tests/relay-to-hostname-mta/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/relay-to-hostname-mta/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,33 +1,34 @@
-
-# this is just for testing. In real life it does not make much sense:
+# running as user is enough for testing purposes
 run_as_user=true
 
 # set debug level (0 = no debugging, 5 = very much, 6 = too much)
-# can also be set with the -d option on the cmd line
 debug_level = 5
 
+# deliver at once
 do_queue = false
 
-# The name with which MasqMail identifies itself to others:
+# identify with some name that is *not* the one of the our machine
+# maybe we should not define a name at all, but this may lead to
+# problems. Could be we even need a FQDN here.
 host_name="MASQMAIL-TEST"
 
-# where MasqMail stores its spool files and other stuff:
+# we want to deliver through a route named `test' to a local MTA
+# thus we do not define any hosts or nets as local
+# all mail should go through the `test' route.
+online_detect = "file"
+online_file = "PWD/online"
+online_routes.test = "PWD/test.route"
+
+# spool files in the current directory
 spool_dir="PWD"
 
-# where local mail will be written to:
+# deliver local mails into the current directory
 mail_dir="PWD"
 
-# use syslogd for logs?
+# log into the current directory
 use_syslog=false
-
-# directory for log files if not using syslogd:
 log_dir="PWD"
 
-online_routes.test = "PWD/test.route"
-
+# relative paths to the warn/failure message templates
 errmsg_file="PWD/../../tpl/failmsg.tpl"
 warnmsg_file="PWD/../../tpl/warnmsg.tpl"
-
-online_detect = "file"
-online_file = "PWD/online"
-
--- a/tests/relay-to-hostname-mta/test.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/relay-to-hostname-mta/test.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,12 +1,12 @@
-#! /bin/bash
+#!/bin/sh
 
-# should be run from within tests dir set if you move this:
+# path to the masqmail executable
 mm_bin=../../src/masqmail
 
 hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
 hto="$hfrom"
 to=`logname`@RECV_HOST
-hsubject="MasqMail stdin Test"
+hsubject="Masqmail test: relay-to-hostname-mta"
 
 
 # Testing with rcpt on cmd line
@@ -21,7 +21,6 @@
 Subject: $hsubject
 
 Hallo Fritz!
-
 ..
 there is a dot above (Yes, one and not two).
 
@@ -32,7 +31,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt on cmd line with -oi option
 # (dot does not end)
 #
@@ -54,7 +53,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt read from headers (-t option)
 # (dot does end)
 #
--- a/tests/relay-to-localhost-mta/test.conf.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/relay-to-localhost-mta/test.conf.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,33 +1,34 @@
-
-# this is just for testing. In real life it does not make much sense:
+# running as user is enough for testing purposes
 run_as_user=true
 
 # set debug level (0 = no debugging, 5 = very much, 6 = too much)
-# can also be set with the -d option on the cmd line
 debug_level = 5
 
+# deliver at once
 do_queue = false
 
-# The name with which MasqMail identifies itself to others:
+# identify with some name that is *not* the one of the our machine
+# maybe we should not define a name at all, but this may lead to
+# problems. Could be we even need a FQDN here.
 host_name="MASQMAIL-TEST"
 
-# where MasqMail stores its spool files and other stuff:
+# we want to deliver through a route named `test' to a local MTA
+# thus we do not define any hosts or nets as local
+# all mail should go through the `test' route.
+online_detect = "file"
+online_file = "PWD/online"
+online_routes.test = "PWD/test.route"
+
+# spool files in the current directory
 spool_dir="PWD"
 
-# where local mail will be written to:
+# deliver local mails into the current directory
 mail_dir="PWD"
 
-# use syslogd for logs?
+# log into the current directory
 use_syslog=false
-
-# directory for log files if not using syslogd:
 log_dir="PWD"
 
-online_routes.test = "PWD/test.route"
-
+# relative paths to the warn/failure message templates
 errmsg_file="PWD/../../tpl/failmsg.tpl"
 warnmsg_file="PWD/../../tpl/warnmsg.tpl"
-
-online_detect = "file"
-online_file = "PWD/online"
-
--- a/tests/relay-to-localhost-mta/test.tpl	Sun May 30 16:05:49 2010 +0200
+++ b/tests/relay-to-localhost-mta/test.tpl	Sun May 30 16:52:35 2010 +0200
@@ -1,12 +1,12 @@
-#! /bin/bash
+#!/bin/sh
 
-# should be run from within tests dir set if you move this:
+# path to the masqmail executable
 mm_bin=../../src/masqmail
 
 hfrom="\"Fritz Meier\" <`logname`@RECV_HOST>"
 hto="$hfrom"
 to=`logname`@RECV_HOST
-hsubject="MasqMail stdin Test"
+hsubject="Masqmail test: relay-to-localhost-mta"
 
 
 # Testing with rcpt on cmd line
@@ -21,7 +21,6 @@
 Subject: $hsubject
 
 Hallo Fritz!
-
 ..
 there is a dot above (Yes, one and not two).
 
@@ -32,7 +31,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt on cmd line with -oi option
 # (dot does not end)
 #
@@ -54,7 +53,7 @@
 
 EOF
 
-#
+
 # Testing with rcpt read from headers (-t option)
 # (dot does end)
 #