Skip to content

Commit b027043

Browse files
committed
update test
1 parent 89c3070 commit b027043

File tree

2 files changed

+1013
-266
lines changed

2 files changed

+1013
-266
lines changed

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,32 @@ function Test-ExpressRouteCircuitStageCRUD
2121
# Setup
2222
$rgname = 'movecircuit'
2323
$circuitName = Get-ResourceName
24-
$rglocation = Get-ProviderLocation ResourceManagement
24+
$rglocation = "westus"
2525
$resourceTypeParent = "Microsoft.Network/expressRouteCircuits"
26-
$location = Get-ProviderLocation $resourceTypeParent
2726
$location = "westus"
2827
try
2928
{
3029
# Create the resource group
3130
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation
3231

3332
# Create the ExpressRouteCircuit
34-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix test" -PeeringLocation "Silicon Valley Test" -BandwidthInMbps 50 -AllowClassicOperations $true;
33+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix test" -PeeringLocation "Silicon Valley Test" -BandwidthInMbps 50 -AllowClassicOperations $true;
3534

36-
# get Circuit
37-
$getCircuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname
38-
39-
#verification
40-
Assert-AreEqual $rgName $getCircuit.ResourceGroupName
41-
Assert-AreEqual $circuitName $getCircuit.Name
42-
Assert-NotNull $getCircuit.Location
43-
Assert-NotNull $getCircuit.Etag
44-
Assert-AreEqual 0 @($getCircuit.Peerings).Count
45-
Assert-AreEqual "Standard_MeteredData" $getCircuit.Sku.Name
46-
Assert-AreEqual "Standard" $getCircuit.Sku.Tier
47-
Assert-AreEqual "MeteredData" $getCircuit.Sku.Family
48-
49-
50-
# set
51-
$getCircuit.AllowClassicOperations = $false
52-
53-
$getCircuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $getCircuit
35+
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname
36+
# set
37+
$circuit.AllowClassicOperations = $false
38+
$circuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $circuit
5439

5540
#move
56-
Move-AzureRmExpressRouteCircuit -Name -ResourceGroupName -Location -ServiceKey
41+
Move-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname -Location $location -ServiceKey $circuit.ServiceKey -Force
5742

5843
# Delete Circuit
5944
$delete = Remove-AzureRmExpressRouteCircuit -ResourceGroupName $rgname -name $circuitName -PassThru -Force
6045
Assert-AreEqual true $delete
6146

6247
$list = Get-AzureRmExpressRouteCircuit -ResourceGroupName $rgname
6348
Assert-AreEqual 0 @($list).Count
49+
6450
}
6551
finally
6652
{

0 commit comments

Comments
 (0)