tests: Execute once

This commit is contained in:
Björn Busse 2021-03-03 19:24:18 +01:00
parent 150b6875db
commit 7f81df826a

View File

@ -2,28 +2,25 @@
HBASE_HOST="127.0.0.1" HBASE_HOST="127.0.0.1"
HBASE_PORT=16200 HBASE_PORT=16200
ZK_HOST=$HBASE_HOST ZK_HOST="$HBASE_HOST"
ZK_PORT=2181 ZK_PORT=2181
HBASE_TIME_STARTUP=8 HBASE_TIME_STARTUP=8
HBASE_VERSION="2.4.1" HBASE_VERSION="2.4.1"
run_hbase() { test_run_hbase() {
cd "../hbase-${HBASE_VERSION}" cd "../hbase-${HBASE_VERSION}"
./bin/hbase-daemon.sh --config conf start $1 ./bin/hbase-daemon.sh --config conf start $1
sleep ${HBASE_TIME_STARTUP} sleep ${HBASE_TIME_STARTUP}
} }
test_hbase_running() { test_hbase_running() {
nc -vnu -w1 $1 $2 nc -znu -w1 ${1:-"127.0.0.1"} ${2:-"16200"}
} }
test_hbase_zk_running() { test_hbase_zk_running() {
nc -vnu -w1 $1 $2 <<END nc -znu -w1 ${1:-"127.0.0.1"} ${2:-"2181"} <<END
"ruok" "ruok"
END END
} }
export JAVA_HOME=${JAVA_HOME:-"/usr/local"} export JAVA_HOME=${JAVA_HOME:-"/usr/local"}
run_hbase "master"
test_hbase_running ${HBASE_HOST} ${HBASE_PORT}
test_hbase_zk_running ${ZK_HOST} ${ZK_PORT}