summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2008-11-16 11:18:38 -0500
committerMatt Goins <mjgoins@openflows.com>2008-11-16 11:18:38 -0500
commite7c994d6f67d380ed0de21f1500ec395eaab6640 (patch)
treee4c81a45e2dcfdd46409beab222d122751f5f6d7 /tests
parent9aec501a27b51523165a05c4c4da0cc9251424e8 (diff)
parent5d9949335aeb1dec04f530cbb3dfcac24288706a (diff)
Merge commit 'dkg/master'
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/basic b/tests/basic
index 289a1b7..5ba7a25 100755
--- a/tests/basic
+++ b/tests/basic
@@ -13,10 +13,11 @@
# all subcommands in this script should complete without failure:
set -e
+# piped commands should return the code of the first non-zero return
+set -o pipefail
## make sure that the right tools are installed to run the test. the
## test has *more* requirements than plain ol' monkeysphere:
-
which socat || { echo "You must have socat installed to run this test." ; exit 1; }
## FIXME: other checks?
@@ -53,6 +54,7 @@ ssh_test() {
# kill the sshd process if it's still running
kill "$SSHD_PID"
+ SSHD_PID=
set -e
@@ -86,9 +88,16 @@ cleanup() {
echo "### removing temp dir..."
rm -rf "$TEMPDIR"
+ if [ "$SSHD_PID" ] ; then
+ echo "### killing off lingering sshd..."
+ kill "$SSHD_PID"
+ fi
+
wait
}
+SSHD_PID=
+
## setup trap
trap failed_cleanup EXIT
@@ -120,7 +129,6 @@ export MONKEYSPHERE_LOG_LEVEL=DEBUG
export SSHD_CONFIG="$TEMPDIR"/sshd_config
export SOCKET="$TEMPDIR"/ssh-socket
-export SSHD_PID=
# Make sure $DISPLAY is set to convince ssh and monkeysphere to fall
# back on $SSH_ASKPASS. Make sure it's not set to the current actual