From: Daniel Kahn Gillmor Date: Sun, 26 Oct 2008 05:51:13 +0000 (-0400) Subject: testing: move ProxyCommand into a simple shell script to ease invocation (shell logic... X-Git-Tag: monkeysphere_0.16-1~8 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8859ba489c1234a3920cb121c177d06b3b8779f7;p=monkeysphere.git testing: move ProxyCommand into a simple shell script to ease invocation (shell logical operators do not work directly in ProxyCommand argument). --- diff --git a/tests/basic b/tests/basic index a04cc0e..d497d84 100755 --- a/tests/basic +++ b/tests/basic @@ -71,15 +71,15 @@ echo "### copying admin and testuser homes..." cp -a "$TESTDIR"/home/admin "$TEMPDIR"/ cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/ -cat < "$TEMPDIR"/testuser/.ssh/config +cat <> "$TEMPDIR"/testuser/.ssh/config UserKnownHostsFile $TEMPDIR/testuser/.ssh/known_hosts +ProxyCommand $TEMPDIR/testuser/.ssh/proxy-command %h %p $SOCKET EOF -cat < "$TEMPDIR"/testuser/.monkeysphere/monkeysphere.conf +cat <> "$TEMPDIR"/testuser/.monkeysphere/monkeysphere.conf KNOWN_HOSTS=$TEMPDIR/testuser/.ssh/known_hosts EOF - ### SERVER TESTS # setup monkeysphere temp gnupghome directories @@ -142,7 +142,6 @@ gpgadmin --armor --export "$HOSTKEYID" | \ # connect to test sshd, using monkeysphere-ssh-proxycommand to verify # the identity before connection. This should work in both directions! echo "### testuser connecting to sshd socket..." -PROXY_COMMAND="monkeysphere-ssh-proxycommand --no-connect %h && socat STDIO UNIX:${SOCKET}" GNUPGHOME="$TEMPDIR"/testuser/.gnupg \ MONKEYSPHERE_HOME="$TEMPDIR"/testuser/.monkeysphere \ - ssh -F "$TEMPDIR"/testuser/.ssh/config -v -v -v -oProxyCommand="$PROXY_COMMAND" testhost + ssh -F "$TEMPDIR"/testuser/.ssh/config -v -v -v testhost diff --git a/tests/home/testuser/.ssh/config b/tests/home/testuser/.ssh/config index 8610bc9..113a511 100644 --- a/tests/home/testuser/.ssh/config +++ b/tests/home/testuser/.ssh/config @@ -6,4 +6,4 @@ RSAAuthentication no GSSAPIAuthentication no StrictHostKeyChecking yes -# UserKnownHostsFile will be filled in dynamically. +# UserKnownHostsFile and ProxyCommand will be filled in dynamically. diff --git a/tests/home/testuser/.ssh/proxy-command b/tests/home/testuser/.ssh/proxy-command new file mode 100755 index 0000000..630327d --- /dev/null +++ b/tests/home/testuser/.ssh/proxy-command @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# simple socket-based proxy-command wrapper for testing monkeysphere. + +# pass this thing the host, the port, and the socket. + +monkeysphere-ssh-proxycommand --no-connect "$1" "$2" && \ +socat STDIO UNIX:"$3"