Skip to content

Commit

Permalink
add cluster_run style tests to makefile
Browse files Browse the repository at this point in the history
to run these tests just execute "make test"
this reads the b/resources/dev.ini for 2 local servers and conf/py-all-dev.conf

or execute "make test-quick"
this reads the b/resources/dev.ini for 2 local servers and conf/dev-quick.conf

Change-Id: I8c40787405f68539c0a623e2f7eefdac7ed3962e
Reviewed-on: http://review.couchbase.org/9316
Reviewed-by: Farshid Ghods <farshid.ghods@gmail.com>
Tested-by: Farshid Ghods <farshid.ghods@gmail.com>
  • Loading branch information
kbatten committed Sep 6, 2011
1 parent df2a19f commit 99bfd5f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ testrunner:

clean:
rm -rf ${DIST_DIR}

test:
./start_cluster_and_run_tests.sh b/resources/dev.ini conf/py-all-dev.conf

test-quick:
./start_cluster_and_run_tests.sh b/resources/dev.ini conf/dev-quick.conf
31 changes: 31 additions & 0 deletions start_cluster_and_run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

if [[ -z $2 ]] ; then
echo "$0 <ini> <conf>"
exit
fi

ini=$1
conf=$2

servers_count=0
while read line ; do
if $(echo "$line" | grep "^\[.*\]$" &> /dev/null) ; then
section="$line"
read line
fi
if [[ "$section" == "[servers]" && "$line" != "" ]] ; then
servers_count=$((servers_count + 1))
fi
done < $ini

wd=$(pwd)
pushd .
cd ../ns_server
./cluster_run --nodes=$servers_count &> $wd/cluster_run.log &
pid=$!
popd
./testrunner -c $conf -i $ini 2>&1 | tee make_test.log
kill $pid
wait
! grep FAILED make_test.log &> /dev/null

0 comments on commit 99bfd5f

Please sign in to comment.