diff --git a/utils/run-tests.sh b/utils/run-tests.sh index d2892def4e..042a47bc29 100755 --- a/utils/run-tests.sh +++ b/utils/run-tests.sh @@ -30,6 +30,8 @@ positional arguments: optional arguments: -h display this message and exit + -a Do not install Ansible, use host's provided one. + -A SEED.GROUP Replicate Azure's test group and seed (seed is YYYYMMDD) -c CONTAINER use container CONTAINER to run tests -K keep container, even if tests succeed -l list available images @@ -38,7 +40,6 @@ optional arguments: -m MEMORY container memory, in GiB (default: 3) -s TEST_SUITE run all playbooks for test suite, which is a directory under ${WHITE}tests${RST} - -A SEED.GROUP Replicate Azure's test group and seed (seed is YYYYMMDD) -v Increase Ansible verbosity (can be used multiple times) -x Stop on first error. EOF @@ -54,8 +55,8 @@ STOP_CONTAINER="Y" STOP_VIRTUALENV="N" declare -a ENABLED_MODULES declare -a ENABLED_TESTS -read -a ENABLED_MODULES <<< "${IPA_ENABLED_MODULES:-""}" -read -a ENABLED_TESTS <<< "${IPA_ENABLED_MODULES:-""}" +read -r -a ENABLED_MODULES <<< "${IPA_ENABLED_MODULES:-""}" +read -r -a ENABLED_TESTS <<< "${IPA_ENABLED_MODULES:-""}" IMAGE_TAG="fedora-latest" scenario="freeipa-tests" MEMORY=3 @@ -64,15 +65,17 @@ SEED="$(date "+%Y%m%d")" GROUP=1 SPLITS=0 ANSIBLE_COLLECTIONS=${ANSIBLE_COLLECTIONS:-"${engine_collection}"} +SKIP_ANSIBLE="" EXTRA_OPTIONS="" # Process command options -while getopts ":hA:c:ei:Klm:s:vx" option +while getopts ":haA:c:ei:Klm:s:vx" option do case "$option" in h) help && exit 0 ;; + a) SKIP_ANSIBLE="YES" ;; A) [ ${#ENABLED_MODULES[@]} -eq 0 ] || die -u "Can't use '-A' with '-s'" SEED="$(cut -d. -f1 <<< "${OPTARG}" | tr -d "-")" @@ -133,7 +136,7 @@ log info "Installing dependencies from 'requirements-tests.txt'" pip install --upgrade -r "${TOPDIR}/requirements-tests.txt" # shellcheck disable=SC2119 -install_ansible +[ -z "SKIP_ANSIBLE" ] || install_ansible # Ansible configuration export ANSIBLE_ROLES_PATH="${TOPDIR}/roles" diff --git a/utils/shcontainer b/utils/shcontainer index ff774243da..1ed23c797b 100644 --- a/utils/shcontainer +++ b/utils/shcontainer @@ -49,7 +49,7 @@ start_container() { # With docker on Ubuntu, it might take a couple of seconds # for the container to be available. sleep 3 - # run_if_exists ansible_ping "${inventory}" + run_if_exists ansible_ping "${inventory}" run_if_exists query_container_installed_software }