From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Sun, 26 Oct 2008 06:40:29 +0000 (-0400)
Subject: testing: change order of operations to make sure that authentication subkey is availa... 
X-Git-Tag: monkeysphere_0.16-1~3
X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e3864891de9261409297d4d6a959bce89ef5f42a;p=monkeysphere.git

testing: change order of operations to make sure that authentication subkey is available during authorized_keys update.
---

diff --git a/tests/basic b/tests/basic
index 3ef5c6c..9f4d02e 100755
--- a/tests/basic
+++ b/tests/basic
@@ -127,12 +127,6 @@ HostKey ${MONKEYSPHERE_SYSDATADIR}/ssh_host_rsa_key
 AuthorizedKeysFile ${MONKEYSPHERE_SYSDATADIR}/authorized_keys/%u
 EOF
 
-# teach the "server" about the testuser's key
-GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --export testuser | \
-  monkeysphere-server gpg-authentication-cmd --import
-
-monkeysphere-server update-users testuser
-
 # launch test sshd with the new host key.
 echo "### starting sshd..."
 socat EXEC:"/usr/sbin/sshd -f ${SSHD_CONFIG} -i -D -e" "UNIX-LISTEN:${SOCKET}" 2> "$TEMPDIR"/sshd.log &
@@ -152,6 +146,12 @@ monkeysphere gen-subkey --expire 0
 echo "### export server key to testuser..."
 gpgadmin --armor --export "$HOSTKEYID" | gpg --import
 
+# teach the "server" about the testuser's key
+echo "### export testuser key to server..."
+gpg --export testuser | monkeysphere-server gpg-authentication-cmd --import
+echo "### update server authorized_keys file for testuser..."
+monkeysphere-server update-users testuser
+
 # connect to test sshd, using monkeysphere-ssh-proxycommand to verify
 # the identity before connection.  This should work in both directions!
 echo "### testuser connecting to sshd socket..."