scripts: Extract downloading hypervisor-fw to a function

This will reduce the number of locations that it will be necessary to
add authentication support.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford
2023-11-07 13:42:55 +00:00
committed by Bo Chen
parent df242e9468
commit 72e213ebda
4 changed files with 12 additions and 18 deletions

View File

@@ -107,3 +107,12 @@ process_common_args() {
test_binary_args=($@)
}
download_hypervisor_fw() {
FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]')
FW="$WORKLOADS_DIR/hypervisor-fw"
pushd $WORKLOADS_DIR
rm -f $FW
time wget --quiet $FW_URL || exit 1
popd
}