Skip to content

Commit

Permalink
fixup! utils: Rewrite run-tests.sh to use functions and extenal scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeffman committed Jul 15, 2024
1 parent 8f3899c commit 86ee000
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion utils/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down
12 changes: 7 additions & 5 deletions utils/setup_test_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 86ee000

Please sign in to comment.