From 63a6f6097183b5cf63e560de0d8185ae8b97ca87 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 8 Nov 2022 13:36:11 +0100 Subject: [PATCH] ci-automation: Use mapfile to get strings into arrays --- ci-automation/vendor-testing/aws.sh | 5 +---- ci-automation/vendor-testing/equinix_metal.sh | 2 +- ci-automation/vendor_test.sh | 6 +----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ci-automation/vendor-testing/aws.sh b/ci-automation/vendor-testing/aws.sh index f9e3c34f06..ae843a5efc 100755 --- a/ci-automation/vendor-testing/aws.sh +++ b/ci-automation/vendor-testing/aws.sh @@ -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" diff --git a/ci-automation/vendor-testing/equinix_metal.sh b/ci-automation/vendor-testing/equinix_metal.sh index 5f4440fd12..163fbbe58b 100755 --- a/ci-automation/vendor-testing/equinix_metal.sh +++ b/ci-automation/vendor-testing/equinix_metal.sh @@ -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 diff --git a/ci-automation/vendor_test.sh b/ci-automation/vendor_test.sh index f0d657e36d..878cdc9ebf 100644 --- a/ci-automation/vendor_test.sh +++ b/ci-automation/vendor_test.sh @@ -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