diff --git a/ci-automation/vendor-testing/aws.sh b/ci-automation/vendor-testing/aws.sh index 15556df560..505c60ecb2 100755 --- a/ci-automation/vendor-testing/aws.sh +++ b/ci-automation/vendor-testing/aws.sh @@ -60,8 +60,7 @@ run_kola_tests() { --aws-ami="${AWS_AMI_ID}" \ --aws-region="${AWS_REGION}" \ --aws-type="${instance_type}" \ - --aws-iam-profile="${AWS_IAM_PROFILE}" \ - "${@}" + --aws-iam-profile="${AWS_IAM_PROFILE}" } # these are set in ci-config.env diff --git a/ci-automation/vendor-testing/digitalocean.sh b/ci-automation/vendor-testing/digitalocean.sh index e6341371c3..5a497b74eb 100755 --- a/ci-automation/vendor-testing/digitalocean.sh +++ b/ci-automation/vendor-testing/digitalocean.sh @@ -59,8 +59,7 @@ run_kola_tests() { --do-config-file="${config_file}" \ --do-image="${image_name}" \ --parallel="${DIGITALOCEAN_PARALLEL}" \ - --platform=do \ - "${@}" + --platform=do } run_default_kola_tests diff --git a/ci-automation/vendor-testing/equinix_metal.sh b/ci-automation/vendor-testing/equinix_metal.sh index 1a13b42df4..14698509c5 100755 --- a/ci-automation/vendor-testing/equinix_metal.sh +++ b/ci-automation/vendor-testing/equinix_metal.sh @@ -49,8 +49,7 @@ run_kola_tests() { --equinixmetal-project="${EQUINIXMETAL_PROJECT}" \ --equinixmetal-storage-url="${EQUINIXMETAL_STORAGE_URL}" \ --gce-json-key=<(echo "${GCP_JSON_KEY}" | base64 --decode) \ - --equinixmetal-api-key="${EQUINIXMETAL_KEY}" \ - "${@}" + --equinixmetal-api-key="${EQUINIXMETAL_KEY}" } run_default_kola_tests diff --git a/ci-automation/vendor-testing/gce.sh b/ci-automation/vendor-testing/gce.sh index 5241173b77..be937ab106 100755 --- a/ci-automation/vendor-testing/gce.sh +++ b/ci-automation/vendor-testing/gce.sh @@ -68,8 +68,7 @@ run_kola_tests() { --gce-machinetype="${GCE_MACHINE_TYPE}" \ "${extra_arg[@]}" \ --parallel="${GCE_PARALLEL}" \ - --platform=gce \ - "${@}" + --platform=gce } run_default_kola_tests diff --git a/ci-automation/vendor-testing/openstack.sh b/ci-automation/vendor-testing/openstack.sh index 885064d693..99e1519f0d 100755 --- a/ci-automation/vendor-testing/openstack.sh +++ b/ci-automation/vendor-testing/openstack.sh @@ -67,8 +67,7 @@ run_kola_tests() { --openstack-host="${OPENSTACK_HOST}" \ --openstack-keyfile="${openstack_keyfile}" \ --openstack-image="${IMAGE_ID}" \ - --openstack-config-file="${config_file}" \ - "${@}" + --openstack-config-file="${config_file}" } run_default_kola_tests diff --git a/ci-automation/vendor-testing/qemu.sh b/ci-automation/vendor-testing/qemu.sh index 0daa36a5f6..5fb461dc0f 100755 --- a/ci-automation/vendor-testing/qemu.sh +++ b/ci-automation/vendor-testing/qemu.sh @@ -60,8 +60,7 @@ run_kola_tests() { --platform=qemu \ --qemu-bios="${bios}" \ --qemu-image="${QEMU_IMAGE_NAME}" \ - --qemu-skip-mangle \ - "${@}" + --qemu-skip-mangle } run_default_kola_tests diff --git a/ci-automation/vendor-testing/qemu_update.sh b/ci-automation/vendor-testing/qemu_update.sh index 064285bf4b..286aa54afb 100755 --- a/ci-automation/vendor-testing/qemu_update.sh +++ b/ci-automation/vendor-testing/qemu_update.sh @@ -107,8 +107,7 @@ run_kola_tests() { --qemu-bios="${bios}" \ --qemu-image="${image}" \ --update-payload=tmp/flatcar_test_update.gz \ - --qemu-skip-mangle \ - cl.update.payload + --qemu-skip-mangle } run_default_kola_tests diff --git a/ci-automation/vendor-testing/test.sh b/ci-automation/vendor-testing/test.sh index 2c50ff8967..5cd3a39b78 100755 --- a/ci-automation/vendor-testing/test.sh +++ b/ci-automation/vendor-testing/test.sh @@ -48,8 +48,7 @@ run_kola_tests() { kola_run \ --parallel=42 \ - --platform=test \ - "${@}" + --platform=test } run_default_kola_tests diff --git a/ci-automation/vendor-testing/vmware.sh b/ci-automation/vendor-testing/vmware.sh index adf4ddea7e..10a4a6b960 100755 --- a/ci-automation/vendor-testing/vmware.sh +++ b/ci-automation/vendor-testing/vmware.sh @@ -70,8 +70,7 @@ run_kola_tests() { --platform=esx \ --parallel="${VMWARE_ESX_PARALLEL}" \ --esx-config-file "${config_file}" \ - --esx-ova-path "${VMWARE_ESX_IMAGE_NAME}" \ - "${@}" + --esx-ova-path "${VMWARE_ESX_IMAGE_NAME}" } run_default_kola_tests diff --git a/ci-automation/vendor_test.sh b/ci-automation/vendor_test.sh index e7be110e47..10bbd90e39 100644 --- a/ci-automation/vendor_test.sh +++ b/ci-automation/vendor_test.sh @@ -117,6 +117,13 @@ CIA_VENDOR_SCRIPTS_DIR="${ciavts_vendor_scripts_dir}" # Unset all variables with ciavts_ prefix now. unset -v "${!ciavts_@}" +function generate_fail_tapfile() { + local tapfile="${1}"; shift + # rest of the args are test names + echo "1..${#@}" >"${tapfile}" + printf 'not ok - %s\n' "${@}" >>"${tapfile}" +} + trap handle_flaky_setup ERR function handle_flaky_setup() { if [[ -e "${CIA_TAPFILE}" ]]; then @@ -161,8 +168,7 @@ function handle_flaky_setup() { all_tests=( "${CIA_OUTPUT_ALL_TESTS[@]}" ) fi - echo "1..${#all_tests[@]}" >"${CIA_TAPFILE}" - printf 'not ok - %s\n' "${all_tests[@]}" >>"${CIA_TAPFILE}" + generate_fail_tapfile "${CIA_TAPFILE}" "${all_tests[@]}" return 0 } @@ -306,8 +312,6 @@ function merge_tap_files() { # # run_kola_tests that takes the following parameters: # 1 - instance type -# 2 - tap file -# @ - tests to run # # query_kola_tests that takes the following parameters: # 1 - instance type @@ -317,28 +321,26 @@ function merge_tap_files() { # the line will be ignored. # # Typical use: +# +# CIA_OUTPUT_MAIN_INSTANCE=… +# CIA_OUTPUT_ALL_TESTS=( … ) +# CIA_OUTPUT_EXTRA_INSTANCES=( … ) +# CIA_OUTPUT_EXTRA_INSTANCE_TESTS=( … ) +# CIA_OUTPUT_TIMEOUT=… +# # function run_kola_tests() { # local instance_type="${1}"; shift -# local tap_file="${1}"; shift -# kola run … "${@}" +# kola_run … # } # +# # Setup (download and prepare images for kola) +# # function query_kola_tests() { # local instance_type="${1}"; shift # kola list … "${@}" # } # -# args=( -# "${main_instance}" -# "${CIA_TAPFILE}" -# "${CIA_FIRST_RUN}" -# "${other_instance_types[@]}" -# '--' -# 'cl.internet' -# '--' -# "${tests_to_run[@]}" -# ) -# run_kola_tests_on_instances "${args[@]}" +# run_default_kola_tests # # Parameters: # 1 - main instance type - there all the tests are being run @@ -430,6 +432,7 @@ function run_kola_tests_on_instances() { function run_kola_tests_internal() { local instance_type="${1}"; shift local CIA_INTERNAL_TAPFILE="${1}"; shift + local CIA_INTERNAL_TESTS=( "${@}" ) run_kola_tests "${instance_type}" "${@}" } @@ -473,7 +476,7 @@ function run_default_kola_tests() { # run_kola_tests callback used by run_default_kola_tests or # run_kola_tests_on_instances. function kola_run() { - local common_opts + local -a common_opts kola_cmd common_opts=( --board="${CIA_ARCH}-usr" @@ -481,19 +484,21 @@ function kola_run() { --torcx-manifest="${CIA_TORCX_MANIFEST}" --channel="${CIA_CHANNEL}" ) + kola_cmd=() if [[ -n "${CIA_OUTPUT_TIMEOUT:-}" ]]; then - unsafe_code_section \ - timeout --signal=SIGQUIT "${CIA_OUTPUT_TIMEOUT}" \ - kola run "${common_opts[@]}" "${@}" - else - unsafe_code_section \ - kola run "${common_opts[@]}" "${@}" + kola_cmd+=( timeout --signal=SIGQUIT "${CIA_OUTPUT_TIMEOUT}" ) fi + kola_cmd+=( kola run "${common_opts[@]}" "${@}" "${CIA_INTERNAL_TESTS[@]}" ) + # Run in a subshell to avoid executing the err handler. + ( + printf "%q" "${kola_cmd[@]}"; printf '\n' + "${kola_cmd[@]}" || : + ) # In case of timeout, the tapfile might be still missing. But # since we were ignoring the error at the time, handle_flaky_setup # didn't run, so do it now. if [[ ! -e "${CIA_INTERNAL_TAPFILE}" ]]; then - handle_flaky_setup + generate_fail_tapfile "${CIA_INTERNAL_TAPFILE}" "${CIA_INTERNAL_TESTS[@]}" fi }