test suite now auto-detects which flavor of prng support GPG uses.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 28 Oct 2008 22:18:24 +0000 (18:18 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 28 Oct 2008 22:18:24 +0000 (18:18 -0400)
debian/changelog
tests/basic
tests/home/testuser/.gnupg/gpg.conf

index 05383d4feb300feee80a85cf772eb148db2fa9ee..30b33f04244c244a272ef7ab0d405f59188f425a 100644 (file)
@@ -6,6 +6,8 @@ monkeysphere (0.18-1) UNRELEASED; urgency=low
   [ Daniel Kahn Gillmor ]
   * update install to ensure placement of
     /etc/monkeysphere/gnupg-{host,authentication}.conf 
+  * choose either --quick-random or --debug-quick-random depending on
+    which gpg supports for the test suite.
 
  -- Daniel Kahn Gillmor <dkg@fifthhorseman.net>  Tue, 28 Oct 2008 17:58:25 -0400
 
index 393bcc22845e50b9cf61e65a83aa386322f17490..9c3796cd516d770e9168d05b05830c4a3d75eed5 100755 (executable)
@@ -42,6 +42,14 @@ failed_cleanup() {
     cleanup
 }
 
+get_gpg_prng_arg() {
+    if (gpg --quick-random --version >/dev/null 2>&1) ; then
+       echo quick-random
+    elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
+       echo debug-quick-random
+    fi
+}
+
 cleanup() {
     if [ "$SSHD_PID" ] && ( ps "$SSHD_PID" >/dev/null ) ; then 
        echo "### stopping still-running sshd..."
@@ -99,6 +107,8 @@ cat <<EOF >> "$TEMPDIR"/testuser/.monkeysphere/monkeysphere.conf
 KNOWN_HOSTS=$TEMPDIR/testuser/.ssh/known_hosts
 EOF
 
+get_gpg_prng_arg >> "$TEMPDIR"/testuser/.gnupg/gpg.conf
+
 # set up a simple default monkeysphere-server.conf
 cat <<EOF >> "$TEMPDIR"/monkeysphere-server.conf
 AUTHORIZED_USER_IDS="$TEMPDIR/testuser/.monkeysphere/authorized_user_ids"
@@ -118,7 +128,7 @@ EOF
 # create a new host key
 echo "### generating server key..."
 # add gpg.conf with quick-random
-echo "quick-random" >> "$MONKEYSPHERE_SYSCONFIGDIR"/gnupg-host/gpg.conf
+get_gpg_prng_arg >> "$MONKEYSPHERE_SYSCONFIGDIR"/gnupg-host/gpg.conf
 echo | monkeysphere-server gen-key --length 1024 --expire 0 testhost
 # remove the gpg.conf
 rm "$MONKEYSPHERE_SYSCONFIGDIR"/gnupg-host/gpg.conf
index f65c71b97aaf0784a9730e83ea8bac60cd48bd6a..c8cb60d15396258cf62f864be3c26b74fea7206f 100644 (file)
@@ -1,5 +1,3 @@
-# command to avoid depleting the system entropy
-quick-random
 # other options
 verify-options show-uid-validity
 list-options show-uid-validity