1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-28 20:56:03 +00:00

test: Add a test for Exim interactions

This patch adds a new test which makes chasquid send and receive email to/from
Exim.

To make it work we need to add two testing flags to the SMTP courier, which is
not ideal but doesn't muddle the code much.

The test is not very portable, and assumes an exim binary is available, but
does not have to be installed in the system. It includes a helper script to
fetch one from the Debian archives.
This commit is contained in:
Alberto Bertogli
2016-07-21 22:21:48 +01:00
parent aac2d3c061
commit 905161c537
11 changed files with 190 additions and 4 deletions

27
test/t-exim/get-exim4-debian.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
#
# This script downloads the exim4 binary from Debian's package.
# It assumes "apt" is functional, which means it's not very portable, but
# given the nature of these tests that's acceptable for now.
set -e
. $(dirname ${0})/../util/lib.sh
init
# Download and extract the package in .exim-bin
apt download exim4-daemon-light
dpkg -x exim4-daemon-light_*.deb $PWD/.exim-bin/
# Create a symlink to .exim4, which is the directory we will use to store
# configuration, spool, etc.
# The configuration template will look for it here.
mkdir -p .exim4
ln -sf $PWD/.exim-bin/usr/sbin/exim4 .exim4/
# Remove the setuid bit, if there is one - we don't need it and may cause
# confusion and/or security troubles.
chmod -s .exim-bin/usr/sbin/exim4
success