summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-07-14 02:41:14 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-07-14 02:41:14 -0400
commit811990b737bca2bd6ed26f9d002e55a9aa0b0cc2 (patch)
tree9ce57314709bd471c877b2c405843c334ecb6a2e /tests/basic
parentb5913c4e5fe08f332317221ad05e60ec4d51b39d (diff)
test revocation against alternate hostnames so that other tests can run after the revocation tests.
Diffstat (limited to 'tests/basic')
-rwxr-xr-xtests/basic32
1 files changed, 27 insertions, 5 deletions
diff --git a/tests/basic b/tests/basic
index d83749b..8b4a1ca 100755
--- a/tests/basic
+++ b/tests/basic
@@ -72,7 +72,7 @@ ssh_test() {
# make a client connection to the socket
echo "##### starting ssh client..."
ssh-agent bash -c \
- "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config testhost true" \
+ "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config ${target_hostname:-testhost} true" \
|| RETURN="$?"
# kill the sshd process if it's still running
@@ -436,17 +436,39 @@ echo "### making sure we are back to normal..."
monkeysphere-authentication update-users $(whoami)
ssh_test
+
echo
echo "##################################################"
-echo "### ssh connection test with hostname 'testhost2' added..."
+echo "### ssh connection test directly to 'testhost2' without new name..."
+target_hostname=testhost2 ssh_test 255
+echo
+echo "##################################################"
+echo "### add hostname, certify by admin, import by user..."
monkeysphere-host add-hostname testhost2
+< "$MONKEYSPHERE_SYSCONFIGDIR"/ssh_host_rsa_key.pub.gpg gpgadmin --import
+printf "y\ny\n" | gpgadmin --command-fd 0 --sign-key "$HOSTKEYID"
+
+echo
+echo "##################################################"
+echo "### ssh connection test with hostname 'testhost2' added..."
+gpgadmin --export "$HOSTKEYID" | gpg --import
+gpg --check-trustdb
ssh_test
echo
echo "##################################################"
-echo "### ssh connection test for failure with 'testhost' revoked..."
-monkeysphere-host revoke-hostname testhost
-ssh_test 255
+echo "### ssh connection test directly to 'testhost2' ..."
+gpg --import <"$MONKEYSPHERE_SYSCONFIGDIR"/ssh_host_rsa_key.pub.gpg
+gpg --check-trustdb
+target_hostname=testhost2 ssh_test
+
+echo
+echo "##################################################"
+echo "### ssh connection test for failure with 'testhost2' revoked..."
+monkeysphere-host revoke-hostname testhost2
+gpg --import <"$MONKEYSPHERE_SYSCONFIGDIR"/ssh_host_rsa_key.pub.gpg
+gpg --check-trustdb
+target_hostname=testhost2 ssh_test 255
# FIXME: addtest: remove admin as id-certifier and check ssh failure