From 261bfac4d47e4da0a8554b0968706ce30c6cc70c Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Mon, 2 Dec 2024 20:33:30 +0800 Subject: [PATCH] ci: Constrain FW_URL to x86_64 one With 0.5.0 release of `rust-hypervisor-firmware`, `aarch64` binary were added to assets, which causes the `FW_URL` to have multiple download url separated by a white space, thus our integration tests would fail. Constrain `FW_URL` to `hypervisor-fw` to resolve this. Signed-off-by: Ruoqing He --- scripts/test-util.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test-util.sh b/scripts/test-util.sh index b9ecf49b7..20a3a53c8 100644 --- a/scripts/test-util.sh +++ b/scripts/test-util.sh @@ -120,14 +120,17 @@ process_common_args() { } download_hypervisor_fw() { + FW_TAG="0.5.0" if [ -n "$AUTH_DOWNLOAD_TOKEN" ]; then echo "Using authenticated download from GitHub" - FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/latest \ + FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/tags/${FW_TAG} \ --header "Authorization: Token $AUTH_DOWNLOAD_TOKEN" \ - --header "X-GitHub-Api-Version: 2022-11-28" | grep "browser_download_url" | grep -o 'https://.*[^ "]') + --header "X-GitHub-Api-Version: 2022-11-28" | grep "browser_download_url" | + grep -oP '"https://[^"]*hypervisor-fw"' | sed -e 's/^"//' -e 's/"$//') else echo "Using anonymous download from GitHub" - FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]') + FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/tags/${FW_TAG} | + grep "browser_download_url" | grep -oP '"https://[^"]*hypervisor-fw"' | sed -e 's/^"//' -e 's/"$//') fi FW="$WORKLOADS_DIR/hypervisor-fw" pushd "$WORKLOADS_DIR" || exit