Skip to content

Commit

Permalink
Update VM password signin to ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessie Wang committed Jan 19, 2025
1 parent 54baefc commit 64cc892
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions vhdbuilder/packer/test/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ LINUX_SCRIPT_PATH="linux-vhd-content-test.sh"
WIN_CONFIGURATION_SCRIPT_PATH="generate-windows-vhd-configuration.ps1"
WIN_SCRIPT_PATH="windows-vhd-content-test.ps1"
TEST_RESOURCE_PREFIX="vhd-test"
TEST_VM_ADMIN_USERNAME="azureuser"
TEST_VM_ADMIN_USERNAME="testadmin"

if [ -z "${MANAGED_SIG_ID}" ]; then
echo "SIG image version ID from packer output is empty, unable to proceed..."
exit 1
fi
echo "SIG image version ID from packer output: ${MANAGED_SIG_ID}"

set +x
TEST_VM_ADMIN_PASSWORD="TestVM@$(date +%s)"
set -x

# For linux VHDs, override AZURE_LOCATION with PACKER_BUILD_LOCATION to make sure
# we're in the correct region to access the image version from the staging gallery (PackerSigGalleryEastUS)
if [ "${OS_TYPE,,}" == "linux" ]; then
Expand Down Expand Up @@ -92,7 +88,7 @@ if [ "${OS_TYPE,,}" == "linux" ]; then
--name "$VM_NAME" \
--image "$MANAGED_SIG_ID" \
--admin-username "$TEST_VM_ADMIN_USERNAME" \
--admin-password "$TEST_VM_ADMIN_PASSWORD" \
--generate-ssh-keys \
--nics "$TESTING_NIC_ID" \
${TARGET_COMMAND_STRING}
else
Expand All @@ -101,12 +97,12 @@ else
--name "$VM_NAME" \
--image "$MANAGED_SIG_ID" \
--admin-username "$TEST_VM_ADMIN_USERNAME" \
--admin-password "$TEST_VM_ADMIN_PASSWORD" \
--generate-ssh-keys \
--public-ip-address "" \
${TARGET_COMMAND_STRING}
fi

echo "VHD test VM username: $TEST_VM_ADMIN_USERNAME, password: $TEST_VM_ADMIN_PASSWORD"
# echo "VHD test VM username: $TEST_VM_ADMIN_USERNAME, password: $TEST_VM_ADMIN_PASSWORD"

time az vm wait -g "$TEST_VM_RESOURCE_GROUP_NAME" -n "$VM_NAME" --created
capture_benchmark "${SCRIPT_NAME}_create_test_vm"
Expand Down

0 comments on commit 64cc892

Please sign in to comment.