From de36d3b27039141ba6402cb91a19a1d852185a92 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 14:11:42 -0500 Subject: tests: making the temporary directory be created in a new place. make sure the proxy command used in the test is the new subcommand. --- tests/basic | 11 ++++------- tests/home/testuser/.ssh/proxy-command | 3 ++- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'tests') 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" -- cgit v1.2.3 From 8eefc1b98f645d1462442cdb357bfcfe06a9c1e4 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 15:03:25 -0500 Subject: tests/basic ensure that the directory is actually an absolute path, not a relative one. --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/basic b/tests/basic index 0cad727..455c057 100755 --- a/tests/basic +++ b/tests/basic @@ -90,7 +90,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d ${TMPDIR:-"$TESTDIR"/tmp}/monkeyspheretest.XXXXXXX) +TEMPDIR=$(mktemp -d ${TMPDIR:-$(cd "$TESTDIR" && printf "%s" $(pwd)/tmp)}/monkeyspheretest.XXXXXXX) # Use the local copy of executables first, instead of system ones. # This should help us test without installing. -- cgit v1.2.3 From f6b18f9a4ad203fd0e02bc7dab298246ffd4ea22 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 15:19:58 -0500 Subject: set proper permissions on administrator gnupghome. --- tests/basic | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/basic b/tests/basic index 455c057..b0b5e9b 100755 --- a/tests/basic +++ b/tests/basic @@ -32,6 +32,7 @@ which socat >/dev/null || { echo "You must have socat installed to run this test # gpg command for test admin user gpgadmin() { + chmod 0700 "$TEMPDIR"/admin GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg "$@" } -- cgit v1.2.3 From 54d5b4d4dd11e432cec4506d1a1eae1d13eb7f0e Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 14:29:42 -0500 Subject: restoring absolute paths to both TEMPDIR and TESTDIR in tests/basic. --- tests/basic | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/basic b/tests/basic index b0b5e9b..470fffa 100755 --- a/tests/basic +++ b/tests/basic @@ -17,7 +17,8 @@ set -e # piped commands should return the code of the first non-zero return set -o pipefail -export TESTDIR=$(dirname "$0") +# make sure the TESTDIR is an absolute path, not a relative one. +export TESTDIR=$(cd $(dirname "$0") && pwd) source "$TESTDIR"/common @@ -91,7 +92,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d ${TMPDIR:-$(cd "$TESTDIR" && printf "%s" $(pwd)/tmp)}/monkeyspheretest.XXXXXXX) +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. -- cgit v1.2.3 From 6571d48d09d9bbcd7187ae1d99092c9e4eb264d8 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:18:17 -0500 Subject: fixing dumb typo in tests/basic --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/basic b/tests/basic index 470fffa..8c995f5 100755 --- a/tests/basic +++ b/tests/basic @@ -92,7 +92,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d "${TMPDIR:-$TESTDIR/tmp}/monkeyspheretest.XXXXXXX)" +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. -- cgit v1.2.3 From d1819306cb0b60068d41a2c0d09a6e5b81d8b143 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:40:16 -0500 Subject: fixing out-of-date comments --- tests/basic | 2 +- tests/etc/monkeysphere/monkeysphere-authentication.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/basic b/tests/basic index 8c995f5..978f3d9 100755 --- a/tests/basic +++ b/tests/basic @@ -246,7 +246,7 @@ monkeysphere-authentication update-users $(whoami) ###################################################################### ### TESTS -# connect to test sshd, using monkeysphere-ssh-proxycommand to verify +# connect to test sshd, using monkeysphere ssh-proxycommand to verify # the identity before connection. This should work in both directions! echo "##################################################" echo "### ssh connection test for success..." diff --git a/tests/etc/monkeysphere/monkeysphere-authentication.conf b/tests/etc/monkeysphere/monkeysphere-authentication.conf index 9cc396f..b4ecc05 100644 --- a/tests/etc/monkeysphere/monkeysphere-authentication.conf +++ b/tests/etc/monkeysphere/monkeysphere-authentication.conf @@ -1,4 +1,4 @@ -# Base monkeysphere-server.conf for monkeysphere tests +# Base monkeysphere-authentication.conf for monkeysphere tests # AUTHORIZED_USER_IDS variable will be added dynamically during test. -- cgit v1.2.3 From 7485d66be9e4aebaf273b8b4082caa4c2404f6e7 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:53:18 -0500 Subject: tests/basic created the wrong monkeysphere-authentication.conf --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/basic b/tests/basic index 978f3d9..d9399f0 100755 --- a/tests/basic +++ b/tests/basic @@ -206,7 +206,7 @@ echo "##################################################" echo "### setup monkeysphere authentication..." cp "$TESTDIR"/etc/monkeysphere/monkeysphere-authentication.conf "$TEMPDIR"/ cat <> "$TEMPDIR"/monkeysphere-authentication.conf -AUTHORIZED_USER_IDS="$MONKEYSPHERE_HOME/authentication/authorized_user_ids" +AUTHORIZED_USER_IDS="$MONKEYSPHERE_HOME/authorized_user_ids" EOF monkeysphere-authentication setup get_gpg_prng_arg >> "$MONKEYSPHERE_SYSDATADIR"/authentication/sphere/gpg.conf -- cgit v1.2.3