From eea2907daf849d709be4a68b583019f83af7876c Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 6 Dec 2021 17:45:17 +0000 Subject: [PATCH] build: Use OVMF binary released from edk2 repo Fixes: #3415 Signed-off-by: Rob Bradford --- Jenkinsfile | 25 ++---------------------- scripts/run_integration_tests_windows.sh | 13 ++++++++++-- scripts/run_integration_tests_x86_64.sh | 8 ++++++++ tests/integration.rs | 2 +- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9b7402c63..a4797d281 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,17 +34,7 @@ pipeline{ checkout scm } } - stage ('Install azure-cli') { - steps { - installAzureCli() - } - } - stage ('Download assets') { - steps { - sh "mkdir ${env.HOME}/workloads" - sh 'az storage blob download --container-name private-images --file "$HOME/workloads/OVMF-83041af43c.fd" --name OVMF-83041af43c.fd --connection-string "$AZURE_CONNECTION_STRING"' - } - } + stage ('Run OpenAPI tests') { steps { sh "scripts/run_openapi_tests.sh" @@ -107,17 +97,7 @@ pipeline{ checkout scm } } - stage ('Install azure-cli') { - steps { - installAzureCli() - } - } - stage ('Download assets') { - steps { - sh "mkdir ${env.HOME}/workloads" - sh 'az storage blob download --container-name private-images --file "$HOME/workloads/OVMF-83041af43c.fd" --name OVMF-83041af43c.fd --connection-string "$AZURE_CONNECTION_STRING"' - } - } + stage ('Run unit tests for musl') { steps { sh "scripts/dev_cli.sh tests --unit --libc musl" @@ -225,7 +205,6 @@ pipeline{ stage ('Download assets') { steps { sh "mkdir ${env.HOME}/workloads" - sh 'az storage blob download --container-name private-images --file "$HOME/workloads/OVMF-83041af43c.fd" --name OVMF-83041af43c.fd --connection-string "$AZURE_CONNECTION_STRING"' sh 'az storage blob download --container-name private-images --file "$HOME/workloads/windows-server-2019.raw" --name windows-server-2019.raw --connection-string "$AZURE_CONNECTION_STRING"' } } diff --git a/scripts/run_integration_tests_windows.sh b/scripts/run_integration_tests_windows.sh index 061c8f37d..5c73eb668 100755 --- a/scripts/run_integration_tests_windows.sh +++ b/scripts/run_integration_tests_windows.sh @@ -14,7 +14,16 @@ if [ "$hypervisor" = "mshv" ] ; then features_test="--no-default-features --features mshv,common,integration_tests" fi WIN_IMAGE_FILE="/root/workloads/windows-server-2019.raw" -OVMF_FW_FILE="/root/workloads/OVMF-83041af43c.fd" + +WORKLOADS_DIR="/root/workloads" +OVMF_FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/edk2/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]') +OVMF_FW="$WORKLOADS_DIR/OVMF.fd" +if [ ! -f "$OVMF_FW" ]; then + pushd $WORKLOADS_DIR + time wget --quiet $OVMF_FW_URL || exit 1 + popd +fi + BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}" CFLAGS="" TARGET_CC="" @@ -24,7 +33,7 @@ CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/" fi # Check if the images are present -if [[ ! -f ${WIN_IMAGE_FILE} || ! -f ${OVMF_FW_FILE} ]]; then +if [[ ! -f ${WIN_IMAGE_FILE} || ! -f ${OVMF_FW} ]]; then echo "Windows image/firmware not present in the host" exit 1 fi diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index 1f2599083..03910fef0 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -30,6 +30,14 @@ if [ ! -f "$FW" ]; then popd fi +OVMF_FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/edk2/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]') +OVMF_FW="$WORKLOADS_DIR/OVMF.fd" +if [ ! -f "$OVMF_FW" ]; then + pushd $WORKLOADS_DIR + time wget --quiet $OVMF_FW_URL || exit 1 + popd +fi + BIONIC_OS_IMAGE_NAME="bionic-server-cloudimg-amd64.qcow2" BIONIC_OS_IMAGE_URL="https://cloud-hypervisor.azureedge.net/$BIONIC_OS_IMAGE_NAME" BIONIC_OS_IMAGE="$WORKLOADS_DIR/$BIONIC_OS_IMAGE_NAME" diff --git a/tests/integration.rs b/tests/integration.rs index b8b1e7c86..5c439c280 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -63,7 +63,7 @@ mod tests { pub const FOCAL_IMAGE_NAME_VHDX: &str = "focal-server-cloudimg-amd64-custom-20210609-0.vhdx"; pub const WINDOWS_IMAGE_NAME: &str = "windows-server-2019.raw"; - pub const OVMF_NAME: &str = "OVMF-83041af43c.fd"; + pub const OVMF_NAME: &str = "OVMF.fd"; pub const GREP_SERIAL_IRQ_CMD: &str = "grep -c 'IO-APIC.*ttyS0' /proc/interrupts || true"; }