testing: using jobspec instead of SSHD_PID
[monkeysphere.git] / tests / basic
index 23146840bf0e7288f8c0192e3cb3dafc7f60e337..cb3730daddc27bef1cfddaebbf77f5858d31a959 100755 (executable)
@@ -27,10 +27,12 @@ cleanup() {
     read -p "press enter to cleanup and remove tmp:"
 
     echo "### stop sshd..."
-    kill "$SSHD_PID"
+    kill %1
 
     echo "### removing temp dir..."
     rm -rf "$TEMPDIR"
+
+    wait
 }
 
 ## setup trap
@@ -68,7 +70,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
@@ -120,8 +122,6 @@ EOF
 # launch test sshd with the new host key.
 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