Add test framework to test
- Mail encryption (when expected) - Introducer listing, adding and removing - Locals listing, adding and removing
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# source some functions
|
||||
. common.sh
|
||||
|
||||
test_header "Add introducer"
|
||||
|
||||
ELLEN_FPR=$(sq key generate --shared-key --without-password --name "Ellen" --email "ellen@example.com" 2>&1 | grep "Fingerprint:" | cut -d ':' -f 2)
|
||||
|
||||
cd $HUSK_DIR
|
||||
$HUSK_BIN introducer add --cert $ELLEN_FPR --domains "example.org" --config config/config.toml
|
||||
$HUSK_BIN introducer list --config config/config.toml
|
||||
|
||||
create_unix_user fred
|
||||
FRED_FPR=$(sq key generate --shared-key --without-password --name "Fred" --email "fred@example.org" 2>&1 | grep "Fingerprint:" | cut -d ':' -f 2)
|
||||
sleep 1
|
||||
sq pki link retract --cert $FRED_FPR --all
|
||||
|
||||
sq pki vouch add --certifier $ELLEN_FPR --cert $FRED_FPR --email "fred@example.org"
|
||||
|
||||
send_test_mail fred@example.org
|
||||
|
||||
RESULT_CODE=$(expect_mail fred encrypted)
|
||||
|
||||
if [ "$RESULT_CODE" == "1" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test_header "Remove introducer"
|
||||
|
||||
$HUSK_BIN introducer remove --cert $ELLEN_FPR --config config/config.toml
|
||||
$HUSK_BIN introducer list --config config/config.toml
|
||||
|
||||
rm /var/mail/fred
|
||||
send_test_mail fred@example.org
|
||||
|
||||
RESULT_CODE=$(expect_mail fred unencrypted)
|
||||
|
||||
delete_unix_user fred
|
||||
|
||||
exit $RESULT_CODE
|
||||
Reference in New Issue
Block a user