Skip to content

Commit

Permalink
ci-automation: skip torcx depending on OS version
Browse files Browse the repository at this point in the history
  • Loading branch information
t-lo committed Oct 12, 2023
1 parent 96b9c84 commit 0a2d1f9
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 13 deletions.
12 changes: 9 additions & 3 deletions ci-automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ function _test_run_impl() {
mantle_ref=$(cat sdk_container/.repo/manifests/mantle-container)

# Make the torcx artifacts available to test implementation
__prepare_torcx "${arch}" "${vernum}" "${work_dir}"
# NOTE major releases after 3745 do not ship torcx but use sysext.
local major="${FLATCAR_VERSION%%.*}"
if [[ $major -le 3745 ]] ; then
__prepare_torcx "${arch}" "${vernum}" "${work_dir}"
else
echo "true" > "${work_dir}/skip_torcx"
fi

local tap_merged_summary="results-${image}"
local tap_merged_detailed="results-${image}-detailed"
Expand Down Expand Up @@ -214,7 +220,7 @@ function _test_run_impl() {
# determine success based on test results (tapfile).
set +e
touch sdk_container/.env
docker run --pull always --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
docker run --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
-w /work -v "$PWD":/work "${mantle_ref}" \
bash -c "git config --global --add safe.directory /work && \
source sdk_container/.env && \
Expand All @@ -223,7 +229,7 @@ function _test_run_impl() {
rm -f "${work_dir}/first_run"

# Note: git safe.directory is not set in this run as it does not use git
docker run --pull always --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
docker run --rm --name="${container_name}" --privileged --net host -v /dev:/dev \
-w /work -v "$PWD":/work "${mantle_ref}" \
ci-automation/test_update_reruns.sh \
"${arch}" "${vernum}" "${image}" "${retry}" \
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ run_kola_tests() {
--aws-type="${instance_type}" \
--aws-iam-profile="${AWS_IAM_PROFILE}" \
--tapfile="${instance_tapfile}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
"${@}"
}

Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/azure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ run_kola_tests() {
--azure-image-file="${AZURE_IMAGE_NAME}" \
--azure-location="${AZURE_LOCATION}" \
--azure-identity \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
--tapfile="${instance_tapfile}" \
--azure-size="${instance_type}" \
--azure-hyper-v-generation="${hyperv_gen}" \
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/digitalocean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ timeout --signal=SIGQUIT 4h\
--platform=do \
--channel="${CIA_CHANNEL}" \
--tapfile="${CIA_TAPFILE}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
"${@}"

set +x
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/equinix_metal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ run_kola_tests() {
--platform=equinixmetal \
--tapfile="${instance_tapfile}" \
--parallel="${EQUINIXMETAL_PARALLEL}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
--equinixmetal-image-url="${BASE_URL}/${EQUINIXMETAL_IMAGE_NAME}" \
--equinixmetal-installer-image-kernel-url="${BASE_URL}/${PXE_KERNEL_NAME}" \
--equinixmetal-installer-image-cpio-url="${BASE_URL}/${PXE_IMAGE_NAME}" \
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/gce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ run_kola_tests() {
--platform=gce \
--channel="${CIA_CHANNEL}" \
--tapfile="${instance_tapfile}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
"${@}"
}

Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/openstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ timeout --signal=SIGQUIT 2h kola run \
--parallel="${OPENSTACK_PARALLEL}" \
--tapfile="${CIA_TAPFILE}" \
--channel="${CIA_CHANNEL}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
--basename="${kola_test_basename}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
--platform=openstack \
--openstack-network=public \
--openstack-domain=default \
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ kola run \
--qemu-bios="${bios}" \
--qemu-image="${QEMU_IMAGE_NAME}" \
--tapfile="${CIA_TAPFILE}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
${QEMU_KOLA_SKIP_MANGLE:+--qemu-skip-mangle} \
"${devcontainer_opts[@]}" \
"${@}"
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/qemu_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ run_kola_tests() {
--qemu-bios="${bios}" \
--qemu-image="${image}" \
--tapfile="${instance_tapfile}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
--update-payload="${QEMU_UPDATE_PAYLOAD}" \
${QEMU_KOLA_SKIP_MANGLE:+--qemu-skip-mangle} \
"${tests[@]}"
Expand Down
2 changes: 1 addition & 1 deletion ci-automation/vendor-testing/vmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sudo timeout --signal=SIGQUIT 2h kola run \
--platform=esx \
--tapfile="${CIA_TAPFILE}" \
--parallel="${VMWARE_ESX_PARALLEL}" \
--torcx-manifest="${CIA_TORCX_MANIFEST}" \
${CIA_KOLA_TORCX_MANIFEST_OPT} \
--esx-config-file "${config_file}" \
--esx-ova-path "${VMWARE_ESX_IMAGE_NAME}" \
"${@}"
Expand Down
17 changes: 16 additions & 1 deletion ci-automation/vendor_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
# Path to the Torcx manifest. Usually passed to kola through the
# --torcx-manifest parameter.
#
# CIA_KOLA_TORCX_MANIFEST_OPT:
# Torcx manifest version check convenience option for kola.
# Major releases after 3745 do not ship torcx (these use sysext) so
# there's no torcx manifest.
# Will contain "--torcx-manifest=$CIA_TORCX_MANIFEST"
# for MAJOR <= 3745 and is empty for greater versions.
#
# CIA_FIRST_RUN:
# 1 if this is a first run, 0 if it is a rerun of failed tests.
#
Expand Down Expand Up @@ -92,6 +99,7 @@ fi
# directories.
ciavts_tapfile="${PWD}/${ciavts_work_dir}/${ciavts_tapfile}"
ciavts_torcx_manifest="${PWD}/${ciavts_main_work_dir}/torcx_manifest.json"
ciavts_skip_torcx=$(cat "${ciavts_main_work_dir}/skip_torcx")

ciavts_first_run=0
if [[ -f "${ciavts_main_work_dir}/first_run" ]]; then
Expand All @@ -109,9 +117,16 @@ CIA_CHANNEL="${ciavts_channel}"
CIA_TESTSCRIPT="${ciavts_testscript}"
CIA_GIT_VERSION="${ciavts_git_version}"
CIA_BUILD_TYPE="${ciavts_type}"
CIA_TORCX_MANIFEST="${ciavts_torcx_manifest}"
CIA_FIRST_RUN="${ciavts_first_run}"

if [[ "${ciavts_skip_torcx}" = "true" ]] ; then
CIA_TORCX_MANIFEST=""
CIA_KOLA_TORCX_MANIFEST_OPT=""
else
CIA_TORCX_MANIFEST="${ciavts_torcx_manifest}"
CIA_KOLA_TORCX_MANIFEST_OPT="--torcx-manifest=${CIA_TORCX_MANIFEST}"
fi

# Unset all variables with ciavts_ prefix now.
unset -v "${!ciavts_@}"

Expand Down

0 comments on commit 0a2d1f9

Please sign in to comment.