## 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.
# 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
# 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 "##################################################"
# 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"