|
12 | 12 | # limitations under the License.
|
13 | 13 | # ----------------------------------------------------------------------------------
|
14 | 14 |
|
| 15 | +<# |
| 16 | +.SYNOPSIS |
| 17 | +Tests ExpressRouteCircuitCRUD. |
| 18 | +#> |
| 19 | +function Test-ExpressRouteCircuitStageCRUD |
| 20 | +{ |
| 21 | + # Setup |
| 22 | + $rgname = 'movecircuit' |
| 23 | + $circuitName = Get-ResourceName |
| 24 | + $rglocation = "westus" |
| 25 | + $resourceTypeParent = "Microsoft.Network/expressRouteCircuits" |
| 26 | + $location = "westus" |
| 27 | + try |
| 28 | + { |
| 29 | + # Create the resource group |
| 30 | + $resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation |
| 31 | + |
| 32 | + # Create the ExpressRouteCircuit |
| 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; |
| 34 | + |
| 35 | + $circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname |
| 36 | + # set |
| 37 | + $circuit.AllowClassicOperations = $false |
| 38 | + $circuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $circuit |
| 39 | + |
| 40 | + #move |
| 41 | + Move-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname -Location $location -ServiceKey $circuit.ServiceKey -Force |
| 42 | + |
| 43 | + # Delete Circuit |
| 44 | + $delete = Remove-AzureRmExpressRouteCircuit -ResourceGroupName $rgname -name $circuitName -PassThru -Force |
| 45 | + Assert-AreEqual true $delete |
| 46 | + |
| 47 | + $list = Get-AzureRmExpressRouteCircuit -ResourceGroupName $rgname |
| 48 | + Assert-AreEqual 0 @($list).Count |
| 49 | + |
| 50 | + } |
| 51 | + finally |
| 52 | + { |
| 53 | + # Cleanup |
| 54 | + Clean-ResourceGroup $rgname |
| 55 | + } |
| 56 | +} |
| 57 | + |
15 | 58 | <#
|
16 | 59 | .SYNOPSIS
|
17 | 60 | Tests ExpressRouteCircuitCRUD.
|
@@ -75,6 +118,7 @@ function Test-ExpressRouteCircuitCRUD
|
75 | 118 | Assert-AreEqual "equinix" $getCircuit.ServiceProviderProperties.ServiceProviderName
|
76 | 119 | Assert-AreEqual "Silicon Valley" $getCircuit.ServiceProviderProperties.PeeringLocation
|
77 | 120 | Assert-AreEqual "1000" $getCircuit.ServiceProviderProperties.BandwidthInMbps
|
| 121 | + |
78 | 122 |
|
79 | 123 | # Delete Circuit
|
80 | 124 | $delete = Remove-AzureRmExpressRouteCircuit -ResourceGroupName $rgname -name $circuitName -PassThru -Force
|
|
0 commit comments