From 3793cb0afbe70f7cf50262a42b9d732e258baba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Wed, 3 Mar 2021 19:00:03 +0100 Subject: [PATCH] Makefile: Add test target --- Makefile | 4 ++++ tests/test_hbase_up.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/test_hbase_up.sh diff --git a/Makefile b/Makefile index 080d831..e297b19 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,10 @@ all: cd $(hbase_tmp_path)/hbase-protocol-shaded/src/main/protobuf; \ protoc -I=/usr/local/include/ --proto_path=. --python_out=$(bindings_path) server/zookeeper/*.proto +test: + ./hbase-setup.sh + ./bash_unit + ./bash_unit tests/test_hbase_up.sh clean: rm -rf $(hbase_tmp_path) diff --git a/tests/test_hbase_up.sh b/tests/test_hbase_up.sh new file mode 100644 index 0000000..331178b --- /dev/null +++ b/tests/test_hbase_up.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +HBASE_HOST="127.0.0.1" +HBASE_PORT=16200 +ZK_HOST=$HBASE_HOST +ZK_PORT=2181 +HBASE_TIME_STARTUP=8 +HBASE_VERSION="2.4.1" + +run_hbase() { + cd "../hbase-${HBASE_VERSION}" + ./bin/hbase-daemon.sh --config conf start $1 + sleep ${HBASE_TIME_STARTUP} +} + +test_hbase_running() { + nc -vnu -w1 $1 $2 +} + +test_hbase_zk_running() { + nc -vnu -w1 $1 $2 <