From 19ca42b3dd1c3fa656289dcdbe61496367a807f1 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Thu, 14 Apr 2022 14:06:56 +0200 Subject: [PATCH 1/2] ci-automation/vm: build PXE if Equinix Metal is built Signed-off-by: Mathieu Tortuyaux --- ci-automation/vms.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci-automation/vms.sh b/ci-automation/vms.sh index 1cbbca4634..3c7dd0137e 100644 --- a/ci-automation/vms.sh +++ b/ci-automation/vms.sh @@ -59,6 +59,16 @@ function vm_build() { echo "docker container rm -f '${vms_container}'" >> ci-cleanup.sh + # automatically add PXE to formats if we build for Equinix Metal (packet). + local has_packet=0 + local has_pxe=0 + for format; do + [[ "${format}" = 'packet' ]] || [[ "${format}" = 'equinix_metal' ]] && has_packet=1 + [[ "${format}" = 'pxe' ]] && has_pxe=1 + done + + [[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}" + for format; do # keep compatibility with SDK scripts where "equinix_metal" # remains unknown. From 9a98cc29179a9def3a3803fa443df3e16d0bf95f Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 27 Apr 2022 14:19:05 +0900 Subject: [PATCH 2/2] ci-automation/vms: handle platform names and generate the image formats The kola test scripts are named by the platforms. The image naming is also quite difficult to know and remember, e.g., whether "ami" or "ami_vmdk" is needed for AWS tests and whether it's "vmware" or "vmware_ova". To address these problems the vms build stage now accepts the platform names as format input, and for each platform it will automatically generate the needed image types to run the tests. --- ci-automation/vms.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ci-automation/vms.sh b/ci-automation/vms.sh index 3c7dd0137e..7140fcf243 100644 --- a/ci-automation/vms.sh +++ b/ci-automation/vms.sh @@ -69,10 +69,20 @@ function vm_build() { [[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}" - for format; do - # keep compatibility with SDK scripts where "equinix_metal" - # remains unknown. - [ "${format}" = "equinix_metal" ] && format="packet" + # Convert platform names (also used to find the test scripts) to image formats they entail + formats="$*" + if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then + formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d') + formats+=" vmware vmware_insecure vmware_ova vmware_raw" + fi + if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then + formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d') + formats+=" ami ami_vmdk" + fi + # Keep compatibility with SDK scripts where "equinix_metal" remains unknown. + formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g') + + for format in ${formats}; do echo " ################### VENDOR '${format}' ################### " ./run_sdk_container -n "${vms_container}" -C "${image_image}" \ -v "${vernum}" \