From 1372be3f6e09dfc3807b035d5572e6e45d74cbea Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Tue, 26 Nov 2024 17:58:20 +0100 Subject: [PATCH] test/cases/api/azure: actually verify the HyperV Generation --- test/cases/api/azure.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/cases/api/azure.sh b/test/cases/api/azure.sh index cc643a3a2..fdce2ebb8 100644 --- a/test/cases/api/azure.sh +++ b/test/cases/api/azure.sh @@ -120,7 +120,14 @@ function verify() { cloud_login # verify that the image exists and tag it - $AZURE_CMD image show --resource-group "${AZURE_RESOURCE_GROUP}" --name "${AZURE_IMAGE_NAME}" + IMG=$($AZURE_CMD image show --resource-group "${AZURE_RESOURCE_GROUP}" --name "${AZURE_IMAGE_NAME}") + echo "$IMG" | jq -r . + HYPER_V_GEN=$(echo "$IMG" | jq -r '.hyperVGeneration') + if [ "$HYPER_V_GEN" != "V2" ]; then + redprint "$AZURE_IMAGE_NAME isn't hyper v generation V2, but $HYPER_V_GEN" + exit 1 + fi + $AZURE_CMD image update --resource-group "${AZURE_RESOURCE_GROUP}" --name "${AZURE_IMAGE_NAME}" --tags gitlab-ci-test=true # Verify that the image boots and have customizations applied