Commit 203e800a authored by Marcel Huber's avatar Marcel Huber
Browse files

added missing functions to execqueries

parent f8373b37
......@@ -6,15 +6,10 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test -z "$_EX_DIR" && _EX_DIR=.
_HELPERS_DIR="$(realpath -e --relative-to=. "${_MY_DIR}/../Helpers")"
_PARENT_DIR="$(cd "${_MY_DIR}/.." && pwd)"
_WAIT_FOR_IT_LOCATION=${_PARENT_DIR}/wait-for-it.sh
_RM_LIST=""
_setup_execqueries() {
test -f "${_WAIT_FOR_IT_LOCATION}" || {
wget --quiet -O "${_WAIT_FOR_IT_LOCATION}" https://gitlab.dev.ifs.hsr.ch/ifs/wait-for-it/raw/master/wait-for-it.sh ;
chmod +x "${_WAIT_FOR_IT_LOCATION}";
}
test -f "${_WAIT_FOR_IT_LOCATION}" && _RM_LIST="$_RM_LIST:$_WAIT_FOR_IT_LOCATION"
true
}
_exitproc() {
......@@ -114,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script="${_EX_DIR}/${docname}_${dbtype}.sh"
test -f "$_queries_generate_script" || continue
_queries_file=${_EX_DIR}/${docname}_${dbtype}.sql
_RM_LIST="$_RM_LIST:$_queries_file"
_test_date="$(date +%Y%m%d%H%M%S)"
_logbase="${_EX_DIR}/${_EX_NAME}.${dbtype}"
_logfile="${_logbase}.${_test_date}.log"
......
......@@ -6,6 +6,20 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test -z "$_EX_DIR" && _EX_DIR=.
_HELPERS_DIR="$(realpath -e --relative-to=. "${_MY_DIR}/../Helpers")"
_PARENT_DIR="$(cd "${_MY_DIR}/.." && pwd)"
_RM_LIST=""
_setup_execqueries() {
true
}
_exitproc() {
IFS=":"
for f in $_RM_LIST; do
rm -f "$f"
done
}
trap _exitproc INT HUP TERM
db_host=postgres
db_name=${1:-ds2}
......@@ -95,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script="${_EX_DIR}/${docname}_${dbtype}.sh"
test -f "$_queries_generate_script" || continue
_queries_file=${_EX_DIR}/${docname}_${dbtype}.sql
_RM_LIST="$_RM_LIST:$_queries_file"
_test_date="$(date +%Y%m%d%H%M%S)"
_logbase="${_EX_DIR}/${_EX_NAME}.${dbtype}"
_logfile="${_logbase}.${_test_date}.log"
......
......@@ -6,6 +6,20 @@ _EX_NAME="$(basename "${_MY_DIR}")"
test -z "$_EX_DIR" && _EX_DIR=.
_HELPERS_DIR="$(realpath -e --relative-to=. "${_MY_DIR}/../Helpers")"
_PARENT_DIR="$(cd "${_MY_DIR}/.." && pwd)"
_RM_LIST=""
_setup_execqueries() {
true
}
_exitproc() {
IFS=":"
for f in $_RM_LIST; do
rm -f "$f"
done
}
trap _exitproc INT HUP TERM
db_host=postgres
db_name=${1:-bank}
......@@ -95,6 +109,7 @@ for dbtype in MonetDB PostgreSQL; do
_queries_generate_script="${_EX_DIR}/${docname}_${dbtype}.sh"
test -f "$_queries_generate_script" || continue
_queries_file=${_EX_DIR}/${docname}_${dbtype}.sql
_RM_LIST="$_RM_LIST:$_queries_file"
_test_date="$(date +%Y%m%d%H%M%S)"
_logbase="${_EX_DIR}/${_EX_NAME}.${dbtype}"
_logfile="${_logbase}.${_test_date}.log"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment