Files
husk-milter/e2e-tests/tests/40_introducer_create.sh
T
Malte Meiboom 1f8d7e9a3f Add test framework to test
- Mail encryption (when expected)
- Introducer listing, adding and removing
- Locals listing, adding and removing
2026-05-20 14:27:28 +02:00

42 lines
1.1 KiB
Bash

#!/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