From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 19:11:42 +0000 (-0500) Subject: tests: making the temporary directory be created in a new place. make sure the proxy... X-Git-Tag: monkeysphere_0.23~121^2~10 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=de36d3b27039141ba6402cb91a19a1d852185a92;p=monkeysphere.git tests: making the temporary directory be created in a new place. make sure the proxy command used in the test is the new subcommand. --- 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 <> "$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"