Skip to content

Commit 9fb30ac

Browse files
committed
Add TestGetVMSizeFromAllLocations
1 parent c1ef639 commit 9fb30ac

File tree

4 files changed

+658
-0
lines changed

4 files changed

+658
-0
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@
250250
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineProfileTests\TestVirtualMachineProfileWithoutAUC.json">
251251
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
252252
</None>
253+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestGetVMSizeFromAllLocations.json" />
253254
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestLinuxVirtualMachine.json">
254255
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
255256
</None>

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,12 @@ public void TestVMImageCmdletOutputFormat()
109109
{
110110
ComputeTestController.NewInstance.RunPsTest("Test-VMImageCmdletOutputFormat");
111111
}
112+
113+
[Fact]
114+
[Trait(Category.AcceptanceType, Category.CheckIn)]
115+
public void TestGetVMSizeFromAllLocations()
116+
{
117+
ComputeTestController.NewInstance.RunPsTest("Test-GetVMSizeFromAllLocations");
118+
}
112119
}
113120
}

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,3 +1305,17 @@ function Test-VMImageCmdletOutputFormat
13051305

13061306
Assert-OutputContains " Get-AzureVMImageDetail -Location $locStr -PublisherName $publisher -Offer $offer -Skus $sku -Version $ver " @('Id', 'Location', 'PublisherName', 'Offer', 'Sku', 'Version', 'FilterExpression', 'Name', 'DataDiskImages', 'OSDiskImage', 'PurchasePlan');
13071307
}
1308+
1309+
# Test Get VM Size from All Locations
1310+
function Test-GetVMSizeFromAllLocations
1311+
{
1312+
$locations = Get-AzureLocation | where { $_.Name -like 'Microsoft.Compute/virtualMachines' } | select -ExpandProperty Locations;
1313+
foreach ($loc in $locations)
1314+
{
1315+
$vmsizes = Get-AzureVMSize -Location $loc;
1316+
Assert-True { $vmsizes.Count -gt 0 }
1317+
Assert-True { ($vmsizes | where { $_.Name -eq 'Standard_A3' }).Count -eq 1 }
1318+
1319+
Write-Output ('Found VM Size Standard_A3 in Location: ' + $loc);
1320+
}
1321+
}

src/ResourceManager/Compute/Commands.Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests/TestGetVMSizeFromAllLocations.json

Lines changed: 636 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)