testing switching back to SSHD_PID, since the jobspec does not seem to work through...
[monkeysphere.git] / tests / basic
index 23146840bf0e7288f8c0192e3cb3dafc7f60e337..a04cc0ef367d78a27ba5355d164ca836a18a08c1 100755 (executable)
@@ -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 <<EOF > "$TEMPDIR"/testuser/.ssh/config
-UserKnownHosts $TEMPDIR/testuser/.ssh/known_hosts
+UserKnownHostsFile $TEMPDIR/testuser/.ssh/known_hosts
 EOF
 
 cat <<EOF > "$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