From f3f36d2c1ef17a08011897cd980c535482a56202 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Wed, 4 Apr 2012 04:56:20 +0200 Subject: [PATCH] make sure we shutdown the node before we test. --- test/files/test_js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/test/files/test_js b/test/files/test_js index 124eac83..17bdf309 100755 --- a/test/files/test_js +++ b/test/files/test_js @@ -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