Skip to content

Commit 6c67e1e

Browse files
authored
Enable VMTests against legacy images in workflows. (#353)
Pass the Azure Linux core-efi legacy boot images to the VMTests suite to enable the legacy boot tests.
1 parent 5835064 commit 6c67e1e

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.github/workflows/scripts/download-image.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@ CONTAINERS_JSON=$(
3131
--prefix "$IMAGE_NAME/"
3232
)
3333

34-
LATEST_DIR=$(
34+
LATEST_IMAGE=$(
3535
jq \
3636
-r \
3737
--arg image "$IMAGE_NAME" \
38-
'[.[].name | select(endswith("/image.vhdx")) | rtrimstr("/image.vhdx")] | sort | last' \
38+
'[.[].name | select(endswith("/image.vhdx") or endswith("/image.vhd"))] | sort | last' \
3939
<<< "$CONTAINERS_JSON" \
4040
)
4141

42-
echo "Latest: $LATEST_DIR"
42+
echo "Latest: $LATEST_IMAGE"
43+
44+
FILENAME="$(basename "$LATEST_IMAGE")"
4345

4446
az storage blob download \
4547
--auth-mode login \
4648
--account-name "$ACCOUNT" \
4749
--container-name "$CONTAINER" \
48-
--name "$LATEST_DIR/image.vhdx" \
49-
--file "$OUTPUT_DIR/image.vhdx" \
50+
--name "$LATEST_IMAGE" \
51+
--file "$OUTPUT_DIR/$FILENAME" \
5052
--output none

.github/workflows/tests-vmtests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ jobs:
9393
9494
./repo/.github/workflows/scripts/download-image.sh "$AZURE_STORAGE" "$AZURE_CONTAINER" "azure-linux/core-efi-vhdx-2.0-$HOST_ARCH" azl-core-efi-2.0
9595
./repo/.github/workflows/scripts/download-image.sh "$AZURE_STORAGE" "$AZURE_CONTAINER" "azure-linux/core-efi-vhdx-3.0-$HOST_ARCH" azl-core-efi-3.0
96+
97+
if [ "$HOST_ARCH" == "amd64" ]; then
98+
./repo/.github/workflows/scripts/download-image.sh "$AZURE_STORAGE" "$AZURE_CONTAINER" "azure-linux/core-legacy-vhd-2.0-$HOST_ARCH" azl-core-legacy-2.0
99+
./repo/.github/workflows/scripts/download-image.sh "$AZURE_STORAGE" "$AZURE_CONTAINER" "azure-linux/core-legacy-vhd-3.0-$HOST_ARCH" azl-core-legacy-3.0
100+
fi
96101
env:
97102
HOST_ARCH: ${{ inputs.hostArch }}
98103
AZURE_STORAGE: ${{ vars.AZURE_STORAGE }}
@@ -133,12 +138,22 @@ jobs:
133138
134139
pushd ./repo/test/vmtests
135140
141+
CORE_LEGACY_AZL2=""
142+
CORE_LEGACY_AZL3=""
143+
if [ "$HOST_ARCH" == "amd64" ]; then
144+
CORE_LEGACY_AZL2="../../../azl-core-legacy-2.0/image.vhd"
145+
CORE_LEGACY_AZL3="../../../azl-core-legacy-3.0/image.vhd"
146+
fi
147+
136148
sudo make test \
137149
IMAGE_CUSTOMIZER_CONTAINER_TAG="$CONTAINER_TAG" \
138150
CORE_EFI_AZL2="../../../azl-core-efi-2.0/image.vhdx" \
139151
CORE_EFI_AZL3="../../../azl-core-efi-3.0/image.vhdx" \
152+
CORE_LEGACY_AZL2="$CORE_LEGACY_AZL2" \
153+
CORE_LEGACY_AZL3="$CORE_LEGACY_AZL3" \
140154
SSH_PRIVATE_KEY_FILE=~/.ssh/id_ed25519
141155
env:
156+
HOST_ARCH: ${{ inputs.hostArch }}
142157
CONTAINER_TAG: ${{ steps.importContainer.outputs.containerTag }}
143158

144159
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)