summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-04 14:11:42 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-04 14:11:42 -0500
commitde36d3b27039141ba6402cb91a19a1d852185a92 (patch)
tree1d6dbdfeb75784dc255fe276e45fdf1d6bbbcb57
parentfa55936fde40619cdb955a089065d27a67f03f10 (diff)
tests: making the temporary directory be created in a new place. make sure the proxy command used in the test is the new subcommand.
-rwxr-xr-xtests/basic11
-rwxr-xr-xtests/home/testuser/.ssh/proxy-command3
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/basic b/tests/basic
index 5c6b4bb..0cad727 100755
--- a/tests/basic
+++ b/tests/basic
@@ -89,12 +89,8 @@ trap failed_cleanup EXIT
## the tests, not system-wide:
# make temp dir
-TEMPDIR="$TESTDIR"/tmp
-if [ -e "$TEMPDIR" ] ; then
- echo "tempdir '$TEMPDIR' already exists."
- exit 1
-fi
-mkdir -p "$TEMPDIR"
+mkdir -p "$TESTDIR"/tmp
+TEMPDIR=$(mktemp -d ${TMPDIR:-"$TESTDIR"/tmp}/monkeyspheretest.XXXXXXX)
# Use the local copy of executables first, instead of system ones.
# This should help us test without installing.
@@ -130,6 +126,7 @@ cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/
# set up environment for testuser
export TESTHOME="$TEMPDIR"/testuser
export GNUPGHOME="$TESTHOME"/.gnupg
+chmod 0700 "$GNUPGHOME"
export SSH_ASKPASS="$TESTHOME"/.ssh/askpass
export MONKEYSPHERE_HOME="$TESTHOME"/.monkeysphere
cat <<EOF >> "$TESTHOME"/.ssh/config
@@ -236,7 +233,7 @@ gpgadmin --armor --export "$HOSTKEYID" | gpg --import
# teach the "server" about the testuser's key
echo "##################################################"
echo "### export testuser key to server..."
-gpg --export testuser | monkeysphere-authentication gpg-cmd --import
+gpg --export testuser | monkeysphere-authentication expert gpg-cmd --import
# update authorized_keys for user
echo "##################################################"
diff --git a/tests/home/testuser/.ssh/proxy-command b/tests/home/testuser/.ssh/proxy-command
index 21c66fa..214cc23 100755
--- a/tests/home/testuser/.ssh/proxy-command
+++ b/tests/home/testuser/.ssh/proxy-command
@@ -3,6 +3,7 @@
# simple socket-based proxy-command wrapper for testing monkeysphere.
# pass this thing the host, the port, and the socket.
+which monkeysphere >&2
-monkeysphere-ssh-proxycommand --no-connect "$1" "$2" && \
+monkeysphere ssh-proxycommand --no-connect "$1" "$2" && \
exec socat STDIO UNIX:"$3"