1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-22 19:55:55 +00:00

test: Add a new local end-to-end test

This patch introduces a new directory, test/, which contains a simple local
end-to-end test which runs a chasquid binary and uses msmtp to send an email,
which is delivered locally.

As it's the first one, it adds a bunch of common infrastructure to simplify
writing these kinds of tests.

More end-to-end tests will follow, and it's expected that the common
infrastructure will also change significantly to accomodate their needs.
This commit is contained in:
Alberto Bertogli
2016-07-22 01:52:27 +01:00
parent 92d16a0ca9
commit 92a88bd06f
10 changed files with 343 additions and 0 deletions

14
test/util/test-mda Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -e
mkdir -p .mail
# TODO: use flock to lock the file, to prevent atomic writes.
echo "From ${1}" >> .mail/.tmp-${1}
cat >> .mail/.tmp-${1}
X=$?
if [ -e .mail/.tmp-${1} ]; then
mv .mail/.tmp-${1} .mail/${1}
fi
exit $X