summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-28 18:18:24 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-10-28 18:18:24 -0400
commit30ac88c7bd68e38af8b2b06327bc1c6492a337c6 (patch)
tree36c32506f961cdd31c790ce7557ed217ddb42662 /tests/basic
parent3e5ccfd11d143e113944a8c35831618421d90552 (diff)
test suite now auto-detects which flavor of prng support GPG uses.
Diffstat (limited to 'tests/basic')
-rwxr-xr-xtests/basic12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/basic b/tests/basic
index 393bcc2..9c3796c 100755
--- a/tests/basic
+++ b/tests/basic
@@ -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