From 64cc8929f0a0d1caa64589d9c780ceedb7cc0627 Mon Sep 17 00:00:00 2001 From: Jessie Wang Date: Mon, 20 Jan 2025 09:26:56 +1100 Subject: [PATCH] Update VM password signin to ssh --- vhdbuilder/packer/test/run-test.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vhdbuilder/packer/test/run-test.sh b/vhdbuilder/packer/test/run-test.sh index 60e23adc21f..e6c9b7ee634 100755 --- a/vhdbuilder/packer/test/run-test.sh +++ b/vhdbuilder/packer/test/run-test.sh @@ -8,7 +8,7 @@ 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..." @@ -16,10 +16,6 @@ if [ -z "${MANAGED_SIG_ID}" ]; then 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 @@ -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 @@ -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"