X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=tests%2Fbasic;h=9308e21295115968964753e1825f4a46a3ef90b8;hb=d8d8885602a02f0c8f0c964926c88cabee773b91;hp=f76a265ea43bd388ea3fff022ca16b8f50fdd112;hpb=55d985e807f1cbc859fc859ab099eced10356ce4;p=monkeysphere.git diff --git a/tests/basic b/tests/basic index f76a265..9308e21 100755 --- a/tests/basic +++ b/tests/basic @@ -28,6 +28,14 @@ source "$TESTDIR"/common ## test has *more* requirements than plain ol' monkeysphere: which socat >/dev/null || { echo "You must have socat installed to run this test." ; exit 1; } +perl -MCrypt::OpenSSL::RSA -e 1 2>/dev/null || { echo "You must have the perl module Crypt::OpenSSL::RSA installed to run this test. +On debian-derived systems, you can set this up with: + apt-get install libcrypt-openssl-rsa-perl" ; exit 1; } + + +perl -MDigest::SHA1 -e 1 2>/dev/null || { echo "You must have the perl module Digest::SHA1 installed to run this test. +On debian-derived systems, you can set this up with: + apt-get install libdigest-sha1-perl" ; exit 1; } ## FIXME: other checks? @@ -43,6 +51,8 @@ gpgadmin() { # test ssh connection # first argument is expected return code from ssh connection ssh_test() { + local RETURN=0 + umask 0077 CODE=${1:-0} @@ -57,20 +67,16 @@ ssh_test() { sleep 1 done - set +e - # make a client connection to the socket echo "##### starting ssh client..." ssh-agent bash -c \ - "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config testhost true" - RETURN="$?" + "monkeysphere subkey-to-ssh-agent && ssh -F $TEMPDIR/testuser/.ssh/config testhost true" \ + || RETURN="$?" # kill the sshd process if it's still running kill "$SSHD_PID" SSHD_PID= - set -e - echo "##### return $RETURN" if [ "$RETURN" = "$CODE" ] ; then echo "##### ssh connection test returned as desired"