X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=tests%2Fbasic;h=a04cc0ef367d78a27ba5355d164ca836a18a08c1;hb=485b28a03e3f53361a4084921b1d3c68c0fda968;hp=23146840bf0e7288f8c0192e3cb3dafc7f60e337;hpb=a718b8d343f7b7de02be1a27a9f98a0ae52f0071;p=monkeysphere.git diff --git a/tests/basic b/tests/basic index 2314684..a04cc0e 100755 --- a/tests/basic +++ b/tests/basic @@ -26,11 +26,15 @@ cleanup() { echo read -p "press enter to cleanup and remove tmp:" - echo "### stop sshd..." - kill "$SSHD_PID" + if ( ps $SSHD_PID >/dev/null ) ; then + echo "### stopping still-running sshd..." + kill $SSHD_PID + fi echo "### removing temp dir..." rm -rf "$TEMPDIR" + + wait } ## setup trap @@ -68,7 +72,7 @@ cp -a "$TESTDIR"/home/admin "$TEMPDIR"/ cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/ cat < "$TEMPDIR"/testuser/.ssh/config -UserKnownHosts $TEMPDIR/testuser/.ssh/known_hosts +UserKnownHostsFile $TEMPDIR/testuser/.ssh/known_hosts EOF cat < "$TEMPDIR"/testuser/.monkeysphere/monkeysphere.conf @@ -122,7 +126,6 @@ echo "### starting sshd..." socat EXEC:"/usr/sbin/sshd -f ${SSHD_CONFIG} -i -d -d -d -D -e" "UNIX-LISTEN:${SOCKET}" 2> "$TEMPDIR"/sshd.log & export SSHD_PID=$! - ### TESTUSER TESTS # generate an auth subkey for the test user