Skip to content

Commit

Permalink
tests: pass in security type when creating VM
Browse files Browse the repository at this point in the history
When running functional tests, pass in --security-type, usually
`TrustedLaunch`, which is nowadays the default for most VMs.
It is still possible to override the security type by passing in
an environment variable $VM_SECURITY_TYPE, like `Standard`.
  • Loading branch information
dongsupark committed Jul 10, 2024
1 parent 5171131 commit 87f8837
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/functional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ VM_SIZE="${VM_SIZE:-Standard_D2lds_v5}"
VM_ADMIN_USERNAME="${VM_ADMIN_USERNAME:-azureuser}"
AZURE_SSH_KEY_NAME="${AZURE_SSH_KEY_NAME:-azure-ssh-key}"
VM_NAME_WITH_TIMESTAMP=$VM_NAME-$EPOCH
VM_SECURITY_TYPE="${VM_SECURITY_TYPE:-TrustedLaunch}"

set -e

Expand Down Expand Up @@ -52,7 +53,8 @@ az vm create -n $VM_NAME_WITH_TIMESTAMP \
--size $VM_SIZE \
--admin-username $VM_ADMIN_USERNAME \
--ssh-key-value $PATH_TO_PUBLIC_SSH_KEY \
--public-ip-sku Standard
--public-ip-sku Standard \
--security-type "$VM_SECURITY_TYPE"
echo "VM successfully created"

echo "Sleeping to ensure SSH access set up"
Expand Down

0 comments on commit 87f8837

Please sign in to comment.