Skip to content

Commit

Permalink
make sure we shutdown the node before we test.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Apr 4, 2012
1 parent d337d5a commit f3f36d2
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions test/files/test_js
Expand Up @@ -13,6 +13,20 @@ RUNNER_LOG_DIR={{runner_log_dir}}
# Make sure CWD is set to runner base dir # Make sure CWD is set to runner base dir
cd $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 # Parse out release and erts info
START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data` START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
ERTS_VSN=${START_ERL% *} ERTS_VSN=${START_ERL% *}
Expand Down Expand Up @@ -48,16 +62,15 @@ fi




STARTED=`$NODETOOL ping` STARTED=`$NODETOOL ping`

# stop couch if needed
# start CouchDB if [ "$STARTED" = "pong" ]; then
if [ "$STARTED" != "pong" ]; then $COUCHBIN stop
$COUCHBIN start
sleep 1 # give it a sec
else
$COUCHBIN reboot
sleep 1
fi fi


# start a new couch instance
$COUCHBIN start
sleep 1 # give it a sec

# start the tests # start the tests
echo "http://127.0.0.1:{{couchdb_port}}/" > $COUCH_URI echo "http://127.0.0.1:{{couchdb_port}}/" > $COUCH_URI


Expand Down

0 comments on commit f3f36d2

Please sign in to comment.