Files
husk-milter/e2e-tests/tests/20_simple_encrypt.sh
T
Malte Meiboom 5fda3924db Add end-to-end Test
- Add an infrastructur to run local e2e tests.
- Add some tests.
2026-01-23 13:56:05 +01:00

26 lines
520 B
Bash

#!/usr/bin/bash
echo "Simple: Test encryption for available certificate"
# There is an authenticated certificate for bob in the cert store
adduser --shell /bin/bash --disabled-password --gecos "" bob
echo "test mail" | sendmail bob@example.com
sleep 1
if [ -f /var/mail/bob ] ; then
if grep -q "BEGIN PGP MESSAGE" /var/mail/bob ; then
RESULT_CODE=0
else
echo "no encryption detected"
RESULT_CODE=1
fi
else
echo "no mail detected"
RESULT_CODE=1
fi
deluser --remove-home bob
exit $RESULT_CODE