From 24213a5c96eb40f172888995f8dcefd5c9f3310b Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 22 Jul 2022 09:01:45 +0200 Subject: [PATCH] ci-automation: Download correct previous image for LTS release qemu_update vendor test was downloading a wrong LTS image when it was testing the old LTS image. This is because it was using a current symlink, which for LTS channel will always point to the new LTS. Old LTS is available under current-${YEAR} symlink. We can get the information about year from the lts-info file. --- ci-automation/vendor-testing/qemu_update.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ci-automation/vendor-testing/qemu_update.sh b/ci-automation/vendor-testing/qemu_update.sh index 1ce875f684..c9ea294461 100755 --- a/ci-automation/vendor-testing/qemu_update.sh +++ b/ci-automation/vendor-testing/qemu_update.sh @@ -35,7 +35,23 @@ if [ -f tmp/flatcar_production_image_previous.bin ] ; then else echo "++++ ${CIA_TESTSCRIPT}: downloading flatcar_production_image_previous.bin from previous ${CIA_CHANNEL} ++++" rm -f tmp/flatcar_production_image_previous.bin.bz2 - curl -fsSLO --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 "https://${CIA_CHANNEL}.release.flatcar-linux.net/${CIA_ARCH}-usr/current/flatcar_production_image.bin.bz2" + SUFFIX='' + if [[ "${CIA_CHANNEL}" = 'lts' ]]; then + LINE='' + CURRENT_MAJOR="${CIA_VERNUM%%.*}" + curl -fsSLO --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 'https://lts.release.flatcar-linux.net/lts-info' + while read -r LINE; do + # each line is major:year:(supported|unsupported) + TUPLE=(${LINE//:/ }) + MAJOR="${TUPLE[0]}" + if [[ "${CURRENT_MAJOR}" = "${MAJOR}" ]]; then + SUFFIX="-${TUPLE[1]}" + break + fi + done