Add test framework to test
- Mail encryption (when expected) - Introducer listing, adding and removing - Locals listing, adding and removing
This commit is contained in:
@@ -1,25 +1,16 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
echo "Simple: Test encryption for available certificate"
|
||||
# source some functions
|
||||
. common.sh
|
||||
|
||||
test_header "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
|
||||
create_unix_user bob
|
||||
send_test_mail bob@example.com
|
||||
|
||||
sleep 1
|
||||
RESULT_CODE=$(expect_mail bob encrypted)
|
||||
|
||||
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
|
||||
delete_unix_user bob
|
||||
|
||||
exit $RESULT_CODE
|
||||
|
||||
Reference in New Issue
Block a user