Skip to content

Commit 4bfe1c5

Browse files
committed
test
1 parent be4e297 commit 4bfe1c5

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7414,45 +7414,44 @@ def test_image_version_with_target_extended_locations(self):
74147414
# Creates an image version and replicates it to the first edge zone
74157415
self.cmd(
74167416
'sig image-version create --resource-group {rg} --gallery-name {gallery} --gallery-image-definition {image}'
7417-
' --gallery-image-version {version} --os-snapshot {disk_id}',
7418-
# checks=[
7419-
# self.check('length(publishingProfile.targetExtendedLocations)', 1),
7420-
# self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7421-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
7422-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.type', 'EdgeZone'),
7423-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7424-
# ]
7425-
)
7417+
' --gallery-image-version {version} --os-snapshot {disk_id} --target-edge-zones "{region1}={edge_zone1}=1"',
7418+
checks=[
7419+
self.check('length(publishingProfile.targetExtendedLocations)', 1),
7420+
self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7421+
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
7422+
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.type', 'EdgeZone'),
7423+
self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7424+
])
74267425

74277426
# Replicate to two edge zones with different storage types
74287427
self.cmd(
74297428
'sig image-version update --resource-group {rg} --gallery-name {gallery} --gallery-image-definition {image} '
7430-
'--gallery-image-version {version} --target-edge-zones "{region2}={edge_zone2}=1=premium_lrs"', # "{region1}={edge_zone1}=1=standardssd_lrs"
7429+
'--gallery-image-version {version} --target-edge-zones "{region1}={edge_zone1}=1=standardssd_lrs" "{region2}={edge_zone2}=1=premium_lrs"',
74317430
checks=[
7432-
self.check('length(publishingProfile.targetExtendedLocations)', 1),
7433-
# self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7434-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
7435-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7436-
# self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'StandardSSD_LRS'),
7437-
self.check('publishingProfile.targetExtendedLocations[0].name', 'West US'),
7438-
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone2}'),
7431+
self.check('length(publishingProfile.targetExtendedLocations)', 2),
7432+
self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7433+
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
74397434
self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7440-
self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'Premium_LRS'),
7435+
self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'StandardSSD_LRS'),
7436+
self.check('publishingProfile.targetExtendedLocations[1].name', 'West US'),
7437+
self.check('publishingProfile.targetExtendedLocations[1].extendedLocation.name', '{edge_zone2}'),
7438+
self.check('publishingProfile.targetExtendedLocations[1].extendedLocationReplicaCount', 1),
7439+
self.check('publishingProfile.targetExtendedLocations[1].storageAccountType', 'Premium_LRS'),
74417440
])
74427441

74437442
# Target extended locations will not be updated if --target-edge-zones is not specified
74447443
self.cmd(
74457444
'sig image-version update --resource-group {rg} --gallery-name {gallery} --gallery-image-definition {image} --gallery-image-version {version}',
74467445
checks=[
7447-
self.check('length(publishingProfile.targetExtendedLocations)', 1),
7448-
# self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7449-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
7450-
# self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7451-
# self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'StandardSSD_LRS'),
7452-
self.check('publishingProfile.targetExtendedLocations[0].name', 'West US'),
7453-
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone2}'),
7446+
self.check('length(publishingProfile.targetExtendedLocations)', 2),
7447+
self.check('publishingProfile.targetExtendedLocations[0].name', 'South Central US'),
7448+
self.check('publishingProfile.targetExtendedLocations[0].extendedLocation.name', '{edge_zone1}'),
74547449
self.check('publishingProfile.targetExtendedLocations[0].extendedLocationReplicaCount', 1),
7455-
self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'Premium_LRS'),
7450+
self.check('publishingProfile.targetExtendedLocations[0].storageAccountType', 'StandardSSD_LRS'),
7451+
self.check('publishingProfile.targetExtendedLocations[1].name', 'West US'),
7452+
self.check('publishingProfile.targetExtendedLocations[1].extendedLocation.name', '{edge_zone2}'),
7453+
self.check('publishingProfile.targetExtendedLocations[1].extendedLocationReplicaCount', 1),
7454+
self.check('publishingProfile.targetExtendedLocations[1].storageAccountType', 'Premium_LRS'),
74567455
])
74577456

74587457
# Target extended locations will be updated to None if '--target-edge-zones None' is specified

0 commit comments

Comments
 (0)