From 921de627150916b7ffe6b5acac143a583a556768 Mon Sep 17 00:00:00 2001 From: Sebastian Sura Date: Thu, 23 May 2024 15:16:48 +0200 Subject: [PATCH] functions: add run_headless_dbcheck and run_query commands --- systemtests/scripts/functions | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/systemtests/scripts/functions b/systemtests/scripts/functions index 76453f4f4cb..c384470a6b8 100644 --- a/systemtests/scripts/functions +++ b/systemtests/scripts/functions @@ -547,6 +547,24 @@ run_bscan_db() run_bscan -n "$db_name" -u "$db_user" -P "$db_password" "$@" } +run_query() +{ + # hope that no pw is set + print_debug "run query $*" + PGOPTIONS="--client-min-messages=warning" psql -d "${db_name}" -q -c "$@" +} + +run_headless_dbcheck() +{ + print_debug "checking with ${BAREOS_DBCHECK_BINARY}" + if test "$debug" -eq 1 ; then + "${BAREOS_DBCHECK_BINARY}" "${working_dir}" "${db_name}" "${db_user}" "${db_password}" --verbose -d 500 "$@" | tee "${tmp}/dbcheck.out" + else + "${BAREOS_DBCHECK_BINARY}" "${working_dir}" "${db_name}" "${db_user}" "${db_password}" -b "$@" >"${tmp}/dbcheck.out" 2>&1 + fi +} + + run_bcopy() { print_debug "bcopying with ${BAREOS_BCOPY_BINARY}"