Skip to content

Commit 726ecac

Browse files
diagavalNickcandy
andauthored
Adding resiliency model as an optional parameter on virtual network gateway for ExpressRoute (#26485)
* initial commit * nit fixes * nit fix * Warning message updated * updated help docs --------- Co-authored-by: NanxiangLiu <[email protected]>
1 parent ebff8b3 commit 726ecac

File tree

10 files changed

+13660
-11
lines changed

10 files changed

+13660
-11
lines changed

src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,13 @@ public void TestVirtualNetworkExpressRouteGatewayUpdatesForDifferentCustomerBloc
195195
{
196196
TestRunner.RunTestScript("Test-VirtualNetworkExpressRouteGatewayForDifferentCustomerBlockTrafficPreferences");
197197
}
198+
199+
[Fact]
200+
[Trait(Category.AcceptanceType, Category.CheckIn)]
201+
[Trait(Category.Owner, NrpTeamAlias.exrdev)]
202+
public void TestVirtualNetworkExpressRouteGatewayCRUDwithResiliencyModel()
203+
{
204+
TestRunner.RunTestScript("Test-VirtualNetworkExpressRouteGatewayCRUDwithResiliencyModel");
205+
}
198206
}
199207
}

src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayTests.ps1

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,4 +1747,55 @@ function Test-VirtualNetworkExpressRouteGatewayForDifferentCustomerBlockTrafficP
17471747
# Cleanup
17481748
Clean-ResourceGroup $rgname
17491749
}
1750-
}
1750+
}
1751+
1752+
<#
1753+
.SYNOPSIS
1754+
Virtual network gateway Resiliency Model test
1755+
#>
1756+
function Test-VirtualNetworkExpressRouteGatewayCRUDwithResiliencyModel
1757+
{
1758+
# Setup
1759+
$rgname = Get-ResourceGroupName
1760+
$rname = Get-ResourceName
1761+
$rname2 = Get-ResourceName
1762+
$vnetName = Get-ResourceName
1763+
$publicIpName = Get-ResourceName
1764+
$publicIpName2 = Get-ResourceName
1765+
$vnetGatewayConfigName = Get-ResourceName
1766+
$rglocation = "centraluseuap"
1767+
$resourceTypeParent = "Microsoft.Network/virtualNetworkGateways"
1768+
$location = "centraluseuap"
1769+
1770+
try
1771+
{
1772+
# Create the resource group
1773+
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
1774+
1775+
# Create the Virtual Network
1776+
$subnet = New-AzVirtualNetworkSubnetConfig -Name "GatewaySubnet" -AddressPrefix 10.0.0.0/24
1777+
$vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet
1778+
$vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname
1779+
$subnet = Get-AzVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $vnet
1780+
1781+
# Create the publicip
1782+
$publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Static
1783+
1784+
# Create & Get virtualnetworkgateway
1785+
$vnetIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet
1786+
1787+
$actual = New-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType ExpressRoute -GatewaySku UltraPerformance -ResiliencyModel MultiHomed
1788+
$expected = Get-AzVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
1789+
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
1790+
Assert-AreEqual $expected.Name $actual.Name
1791+
Assert-AreEqual "ExpressRoute" $expected.GatewayType
1792+
Assert-AreEqual "Disabled" $expected.AdminState
1793+
Assert-AreEqual "MultiHomed" $expected.ResiliencyModel
1794+
1795+
}
1796+
finally
1797+
{
1798+
# Cleanup
1799+
Clean-ResourceGroup $rgname
1800+
}
1801+
}

0 commit comments

Comments
 (0)