Skip to content

Commit

Permalink
FIXUP: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeffman committed Jun 30, 2024
1 parent 0be0335 commit 6a5d792
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions utils/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 "-")"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion utils/shcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 6a5d792

Please sign in to comment.