X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=tests%2Fbasic;h=83bf7536a04c4a57dbe6e67624b2b61c6f6a42f1;hb=9a164c608691a9d5c00bde47160c01ef39be56b3;hp=d83749bd6e94bb6b629e870c50870d63c53cb835;hpb=adef51285ea488ecda7b0a77b142d99e022d9e10;p=monkeysphere.git diff --git a/tests/basic b/tests/basic index d83749b..83bf753 100755 --- a/tests/basic +++ b/tests/basic @@ -66,17 +66,18 @@ ssh_test() { # wait until the socket is created before continuing while [ ! -S "$SOCKET" ] ; do - sleep 2 + sleep 1 done # 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 kill "$SSHD_PID" || true + wait SSHD_PID= if [ "$RETURN" = "$CODE" ] ; then @@ -436,17 +437,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