From 86ee000fc971852e2f5c9fe86e3cdbfe00346bd4 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 9 Jul 2024 10:53:06 -0300 Subject: [PATCH] fixup! utils: Rewrite run-tests.sh to use functions and extenal scripts --- utils/run-tests.sh | 2 +- utils/setup_test_container.sh | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/utils/run-tests.sh b/utils/run-tests.sh index 7384dabded..9bdad7fcd8 100755 --- a/utils/run-tests.sh +++ b/utils/run-tests.sh @@ -73,7 +73,7 @@ unset ANSIBLE_VERSION # Process command options -while getopts ":haa:Ac:ei:Klm:p:s:S:vx" option +while getopts ":ha:Ac:ei:Klm:p:s:S:vx" option do case "$option" in h) help && exit 0 ;; diff --git a/utils/setup_test_container.sh b/utils/setup_test_container.sh index e4f3ac289c..51434081d7 100755 --- a/utils/setup_test_container.sh +++ b/utils/setup_test_container.sh @@ -107,19 +107,21 @@ log info "Testing kinit with admin." # shellcheck disable=SC2154 log info "Creating inventory." make_inventory "${scenario}" "${engine}" "${ansible_interpreter:-"/usr/bin/python3"}" -if [ -z "${inventory}" ] +if [ -z "${inventory:-''}" ] then log error "Could not create inventory file." else + # shellcheck disable=SC2154 log info "Inventory path: [${inventory}]" # shellcheck disable=SC2154 log debug "$(cat "${inventory}")" if [ "${ansible_test}" == "yes" ] then - log info "Testing Asnible connection." - run_if_exists ansible_ping "${inventory}" - log info "Querying installed software" - run_if_exists query_container_installed_software + log info "Testing Ansible connection." + # shellcheck disable=SC2154 + run_if_exists ansible_ping "${inventory}" + log info "Querying installed software" + run_if_exists query_container_installed_software fi fi