ci-automation: Use mapfile to get strings into arrays

This commit is contained in:
Krzesimir Nowak 2022-11-08 13:36:11 +01:00
parent 36099964a4
commit 63a6f60971
3 changed files with 3 additions and 10 deletions

View File

@ -16,10 +16,7 @@ image_name="ci-${escaped_vernum}-${CIA_ARCH}"
aws_instance_type_var="AWS_${CIA_ARCH}_INSTANCE_TYPE"
aws_instance_type="${!aws_instance_type_var}"
more_aws_instance_types_var="AWS_${CIA_ARCH}_MORE_INSTANCE_TYPES"
set -o noglob # there shouldn't be any instance types with asterisks
# in it, but…
more_aws_instance_types=( ${!more_aws_instance_types_var} )
set +o noglob
mapfile -t more_aws_instance_types < <(tr ' ' '\n' <<<"${!more_aws_instance_types_var}")
image_file='flatcar_production_ami_image.bin'
tarball="${image_file}.bz2"

View File

@ -18,7 +18,7 @@ equinixmetal_metro="${!equinixmetal_metro_var}"
EQUINIXMETAL_INSTANCE_TYPE_VAR="EQUINIXMETAL_${CIA_ARCH}_INSTANCE_TYPE"
EQUINIXMETAL_INSTANCE_TYPE="${!EQUINIXMETAL_INSTANCE_TYPE_VAR}"
MORE_INSTANCE_TYPES_VAR="EQUINIXMETAL_${CIA_ARCH}_MORE_INSTANCE_TYPES"
MORE_INSTANCE_TYPES=( ${!MORE_INSTANCE_TYPES_VAR} )
mapfile -t MORE_INSTANCE_TYPES < <(tr ' ' '\n' <<<"${!MORE_INSTANCE_TYPES_VAR}")
# The maximum is 6h coming from the ore GC duration parameter
timeout=6h

View File

@ -342,12 +342,8 @@ function run_kola_tests_on_instances() {
# to filter the extra tests first then we decide which tests
# should be run.
if [[ "${is_first_run}" -eq 1 ]]; then
set -o noglob # noglob should not be necessary, as
# query_kola_tests shouldn't return a
# wildcard, but better to be safe than sorry
queried_tests="$(query_kola_tests "${instance_type}" "${@}")"
instance_tests=( $(grep --only-matching --fixed-strings "${other_tests_for_fgrep}" <<<"${queried_tests}" || :) )
set +o noglob
mapfile -t instance_tests < <(grep --only-matching --fixed-strings "${other_tests_for_fgrep}" <<<"${queried_tests}" || :)
else
filter_prefixed_tests instance_tests "${instance_type}" "${@}"
fi