test/cases/ubi-wsl: test rhel9 ga

This commit is contained in:
Sanne Raymaekers 2024-05-27 13:52:58 +02:00
parent 0ad74e0f34
commit 5d1094a94e
2 changed files with 21 additions and 8 deletions

View file

@ -622,9 +622,12 @@ ubi-wsl.sh:
script: script:
- schutzbot/deploy.sh - schutzbot/deploy.sh
- /usr/libexec/tests/osbuild-composer/ubi-wsl.sh - /usr/libexec/tests/osbuild-composer/ubi-wsl.sh
variables: parallel:
RUNNER: aws/rhel-8.9-ga-x86_64 matrix:
INTERNAL_NETWORK: "true" - RUNNER:
- aws/rhel-8.9-ga-x86_64
- aws/rhel-9.3-ga-x86_64
INTERNAL_NETWORK: "true"
weldr-distro-dot-notation+aliases: weldr-distro-dot-notation+aliases:
stage: test stage: test

View file

@ -167,7 +167,7 @@ cloud_login
$AZURE_CMD version $AZURE_CMD version
# Create a windows VM from the WSL snapshot image # Create a windows VM from the WSL snapshot image
if ! $AZURE_CMD snapshot show --name "$AZURE_WSL_SNAPSHOT" --resource-group "$AZURE_RESOURCE_GROUP"; then if ! $AZURE_CMD snapshot show --name "$AZURE_WSL_SNAPSHOT_2" --resource-group "$AZURE_RESOURCE_GROUP"; then
redprint "WSL snapshot missing from test resource group" redprint "WSL snapshot missing from test resource group"
exit 1 exit 1
fi fi
@ -181,7 +181,7 @@ $AZURE_CMD disk create \
--sku "Standard_LRS" \ --sku "Standard_LRS" \
--location "$AZURE_WSL_LOCATION" \ --location "$AZURE_WSL_LOCATION" \
--size-gb 128 \ --size-gb 128 \
--source "$AZURE_WSL_SNAPSHOT" --source "$AZURE_WSL_SNAPSHOT_2"
# Create VM by attaching created managed disks as OS # Create VM by attaching created managed disks as OS
# The VM needs to support virtualization, supposedly all v4 and v5's support this but this wasn't # The VM needs to support virtualization, supposedly all v4 and v5's support this but this wasn't
@ -231,14 +231,24 @@ done
sudo chmod 600 "$AZ_WSL_HOST_PRIVATE_KEY" sudo chmod 600 "$AZ_WSL_HOST_PRIVATE_KEY"
sudo scp -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$DISK" "$AZURE_WSL_USER@$HOST:" sudo scp -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$DISK" "$AZURE_WSL_USER@$HOST:"
# Use absolute path to wsl.exe to avoid "The file cannot be accessed by the system."
ssh -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$AZURE_WSL_USER@$HOST" \ ssh -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$AZURE_WSL_USER@$HOST" \
wsl --import ibwsl ibwsl "$DISK" '"C:\Program Files\WSL\wsl.exe"' --import ibwsl ibwsl "$DISK"
UNAME=$(ssh -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$AZURE_WSL_USER@$HOST" wsl -d ibwsl uname)
UNAME=$(ssh -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$AZURE_WSL_USER@$HOST" '"C:\Program Files\WSL\wsl.exe"' -d ibwsl uname)
if [ ! "$UNAME" = "Linux" ]; then if [ ! "$UNAME" = "Linux" ]; then
redprint "Not running linux on the windows host :(" redprint "Not running linux on the windows host :("
exit 1 exit 1
fi fi
OS_RELEASE=$(ssh -i "$AZ_WSL_HOST_PRIVATE_KEY" -o StrictHostKeyChecking=no "$AZURE_WSL_USER@$HOST" '"C:\Program Files\WSL\wsl.exe"' -d ibwsl cat /etc/os-release)
WSL_ID=$(echo "$OS_RELEASE" | grep "^ID=" | cut -d '=' -f2 | tr -d '"')
WSL_VERSION_ID=$(echo "$OS_RELEASE" | grep "^VERSION_ID=" | cut -d '=' -f2 | tr -d '"')
if [ ! "$DISTRO_CODE" = "$WSL_ID-$WSL_VERSION_ID" ]; then
redprint "wsl os-release ($WSL_ID-$WSL_VERSION_ID) is not the same as the test runner os-release ($DISTRO_CODE)"
exit 1
fi
exit 0 exit 0