Permalink
Browse files

make sure we shutdown the node before we test.

  • Loading branch information...
benoitc committed Apr 4, 2012
1 parent d337d5a commit f3f36d2c1ef17a08011897cd980c535482a56202
Showing with 21 additions and 8 deletions.
  1. +21 −8 test/files/test_js
View
@@ -13,6 +13,20 @@ RUNNER_LOG_DIR={{runner_log_dir}}
# Make sure CWD is set to runner base dir
cd $RUNNER_BASE_DIR
+# Extract the target node name from node.args
+NAME_ARG=`egrep '^-s?name' $RUNNER_ETC_DIR/vm.args`
+if [ -z "$NAME_ARG" ]; then
+ echo "vm.args needs to have either -name or -sname parameter."
+ exit 1
+fi
+
+# Extract the target cookie
+COOKIE_ARG=`grep '^-setcookie' $RUNNER_ETC_DIR/vm.args`
+if [ -z "$COOKIE_ARG" ]; then
+ echo "vm.args needs to have a -setcookie parameter."
+ exit 1
+fi
+
# Parse out release and erts info
START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
ERTS_VSN=${START_ERL% *}
@@ -48,16 +62,15 @@ fi
STARTED=`$NODETOOL ping`
-
-# start CouchDB
-if [ "$STARTED" != "pong" ]; then
- $COUCHBIN start
- sleep 1 # give it a sec
-else
- $COUCHBIN reboot
- sleep 1
+# stop couch if needed
+if [ "$STARTED" = "pong" ]; then
+ $COUCHBIN stop
fi
+# start a new couch instance
+$COUCHBIN start
+sleep 1 # give it a sec
+
# start the tests
echo "http://127.0.0.1:{{couchdb_port}}/" > $COUCH_URI

0 comments on commit f3f36d2

Please sign in to comment.