From 28d24ed8c6c3223c4ef9a9f46f2a4d0f90c51e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Mon, 8 Mar 2021 01:46:06 +0100 Subject: [PATCH] testsuite: Use SCRIPT_PATH --- tests/hbase-setup.sh | 17 +++++++++-------- tests/hdfs-setup.sh | 9 +++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/hbase-setup.sh b/tests/hbase-setup.sh index 0ac4f8e..5691865 100755 --- a/tests/hbase-setup.sh +++ b/tests/hbase-setup.sh @@ -8,25 +8,26 @@ HBASE_DIR="hbase-${HBASE_VERSION}-hadoop2" #HBASE_URL="https://downloads.apache.org/hbase/${HBASE_VERSION}/${HBASE_FILE}" HBASE_URL="https://archive.apache.org/dist/hbase/hbase-${HBASE_VERSION}/${HBASE_FILE}" HBASE_FILE_CKSUM="1625453f839f7d8c86078a131af9731f6df28c59e58870db84913dcbc640d430253134a825de7cec247ea1f0cf232435765e00844ee2e4faf31aeb356955c478" -HBASE_CONFIG_FILE="hbase/conf/hbase-site.xml" +HBASE_CONFIG_TEMPLATE="hbase/conf/hbase-site.xml.j2" HBASE_TEST_SUITE_EXECUTABLE="hbase/bin/hbase" declare -a DEPS=("java") -source setup.sh +SCRIPT_PATH=$(dirname "$0") +source $SCRIPT_PATH/setup.sh -create_hbase_config() { +create_hbase_config_template() { read -r -d '' CONFIG < hbase.rootdir - file:///${1}/hbase + file:///{{ hbase_rootdir }}/hbase hbase.zookeeper.property.dataDir - ${1}/zookeeper + {{ hbase_datadir }}/zookeeper hbase.unsafe.stream.capability.enforce @@ -63,6 +64,6 @@ prepare_hbase() { } check_dependencies -prepare_hbase ${HBASE_URL} -HBASE_CONFIG=$(create_hbase_config "/tmp") -write_file ${HBASE_CONFIG_FILE} "${HBASE_CONFIG}" +#prepare_hbase ${HBASE_URL} +HBASE_CONFIG=$(create_hbase_config_template) +write_file ${HBASE_CONFIG_TEMPLATE} "${HBASE_CONFIG}" diff --git a/tests/hdfs-setup.sh b/tests/hdfs-setup.sh index 451907b..8bd60c2 100755 --- a/tests/hdfs-setup.sh +++ b/tests/hdfs-setup.sh @@ -6,13 +6,14 @@ HADOOP_VERSION="2.10.1" HADOOP_FILE="hadoop-$HADOOP_VERSION.tar.gz" HADOOP_URL="https://artfiles.org/apache.org/hadoop/common/hadoop-${HADOOP_VERSION}/${HADOOP_FILE}" HADOOP_FILE_CKSUM="2460e02cd1f80dfed7a8981bbc934c095c0a341435118bec781fd835ec2ebdc5543a03d92d24f2ddeebdfe1c2c460065ba1d394ed9a73cbb2020b40a8d8b5e07" -HDFS_CONFIG_TEMPLATE="hadoop/etc/hadoop/hdfs-site.xml" -HDFS_CONFIG_TEMPLATE_CORE="hadoop/etc/hadoop/core-site.xml" -HDFS_CONFIG_TEMPLATE_MAPRED="hadoop/etc/hadoop/mapred-site.xml" +HDFS_CONFIG_TEMPLATE="hadoop/etc/hadoop/hdfs-site.xml.j2" +HDFS_CONFIG_TEMPLATE_CORE="hadoop/etc/hadoop/core-site.xml.j2" +HDFS_CONFIG_TEMPLATE_MAPRED="hadoop/etc/hadoop/mapred-site.xml.j2" HDFS_CONFIG_DATANODES="localhost" HDFS_TEST_SUITE_EXECUTABLE="hadoop/bin/hdfs" -source setup.sh +SCRIPT_PATH=$(dirname "$0") +source $SCRIPT_PATH/setup.sh declare -a DEPS=("java" "ansible-playbook")