summaryrefslogtreecommitdiffstats
path: root/debian/minimaltest
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:44:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:44:08 +0000
commit933bbaf3ed7bd659a5c044745aea763815928598 (patch)
tree6fe3906ff9f7121999800da3683c206d128b7d39 /debian/minimaltest
parentAdding upstream version 4.94.2. (diff)
downloadexim4-933bbaf3ed7bd659a5c044745aea763815928598.tar.xz
exim4-933bbaf3ed7bd659a5c044745aea763815928598.zip
Adding debian version 4.94.2-7+deb11u2.debian/4.94.2-7+deb11u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/minimaltest')
-rw-r--r--debian/minimaltest93
1 files changed, 93 insertions, 0 deletions
diff --git a/debian/minimaltest b/debian/minimaltest
new file mode 100644
index 0000000..c90d7b2
--- /dev/null
+++ b/debian/minimaltest
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+set -e
+
+# Do not run as root
+if [ `id -u` = "0" ]; then
+ echo $0: running with id 0, exiting.
+ exit 0
+fi
+
+if ! test -x "$2" ; then
+ echo "\$2 $2: not exeutable"
+ exit 1
+fi
+
+# set up directorytree
+if ! echo "$1" | grep -q '^/......' && test -d "$1"; then
+ echo \$1 needs to be absolute patch
+ exit 1
+fi
+
+echo ========================================
+echo running minimal functionality test for binary $2 in directory $1
+
+top="$1/eximtest"
+
+rm -rf $1/eximtest/*
+mkdir -p $top/var/log $top/var/spool/db $top/var/spool/input $top/var/spool/msglog $top/run $top/var/mail
+cat <<EOF > $top/exim4.conf
+exim_user = `id -u`
+exim_group = `id -g`
+log_file_path = $top/var/log/%slog
+spool_directory = $top/var/spool
+pid_file_path = $top/run
+primary_hostname = eximtest.example.com
+rfc1413_hosts =
+
+begin routers
+eximtest:
+ driver = accept
+ transport = writetofile
+ address_data = \${lookup {\$local_part} lsearch {${top}/maplptofile} {\$value} fail }
+
+begin transports
+writetofile:
+ driver = appendfile
+ file = $top/var/mail/\$address_data
+ delivery_date_add
+ envelope_to_add
+ return_path_add
+EOF
+
+cat <<EOF > $top/maplptofile
+recip: recip
+local: local
+EOF
+
+cat <<EOF > $top/var/mail/compare
+From from@eximtest.example.com Sat May 07 12:12:12 2012
+Return-path: <from@eximtest.example.com>
+Envelope-to: recip@eximtest.example.com
+Delivery-date: Sat, 07 May 2011 12:12:12 +0000
+Received: from buildd by eximtest.example.com with local (Exim 4.44)
+ (envelope-from <from@eximtest.example.com>)
+ id msgid
+ for recip@eximtest.example.com;Sat, 07 May 2011 12:12:12 +0000
+From: Testing Exim <from@eximtest.example.com>
+To: Recipient <recip@eximtest.example.com>
+Subject: Test Message
+Message-Id: <Emsgid@eximtest.example.com>
+Date: Sat, 07 May 2011 12:12:12 +0000
+
+no body
+
+EOF
+
+$2 -C "$top/exim4.conf" -bV
+$2 -C "$top/exim4.conf" -be '${if bool{0}{yes}{no}} X ${if !bool{0}{yes}{no}}'
+$2 -C "$top/exim4.conf" -bt local
+printf 'From: Testing Exim <from@eximtest.example.com>\nTo: Recipient <recip@eximtest.example.com>\nSubject: Test Message\n\nno body\n' | \
+$2 -C "$top/exim4.conf" -odf -oep -oi -t -f from@eximtest.example.com
+sed -i -e 's/^From \([^ ]*\) .*/From \1 Sat May 07 12:12:12 2012/' \
+ -e 's/^Delivery-date: .*/Delivery-date: Sat, 07 May 2011 12:12:12 +0000/' \
+ -e 's/^Received: from [^ ][^ ]* /Received: from buildd /' \
+ -e '/^Received:/s/(Exim [^)]*/(Exim 4.44/' \
+ -e '/[[:space:]]for /s/;.*/;Sat, 07 May 2011 12:12:12 +0000/' \
+ -e '/[[:space:]]id /s/id .*/id msgid/' \
+ -e 's/^Message-Id: [^@]*/Message-Id: <Emsgid/' \
+ -e 's/^Date: .*/Date: Sat, 07 May 2011 12:12:12 +0000/' \
+ $top/var/mail/recip
+
+diff -u $top/var/mail/recip $top/var/mail/compare
+exit 0