# cleanup:
cleanup() {
+ echo
read -p "press enter to cleanup and remove tmp:"
- # FIXME: stop the sshd process
+ echo "### stop sshd..."
+ kill "$SSHD_PID"
- echo
echo "### removing temp dir..."
rm -rf "$TEMPDIR"
-
- # FIXME: how should we clear out the temporary $VARLIB?
-
- # FIXME: clear out ssh client config file and known hosts.
}
## setup trap
# FIXME: how can we test publish-key without flooding junk into the
# keyservers?
-# indicate that the "Admin's" key is an identity certifier for the
-# host
-
+# add admin as identity certifier for testhost
echo "### adding admin as certifier..."
echo y | monkeysphere-server add-identity-certifier "$TESTDIR"/home/admin/.gnupg/pubkey.gpg
echo "### starting sshd..."
socat EXEC:"/usr/sbin/sshd -f ${SSHD_CONFIG} -i -d -d -d -D -e" "UNIX-LISTEN:${SOCKET}" 2> "$TEMPDIR"/sshd.log &
+export SSHD_PID=$!
### TESTUSER TESTS
gpgadmin --armor --export "$HOSTKEYID" | \
GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --import
-#GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --list-keys
-#read -p "?"
-
# connect to test sshd, using monkeysphere to verify the identity
# before connection.
echo "### testuser connecting to sshd socket..."