Skip to content

Add parameters for BGP with VPN gateways #1966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.2.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.3.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package id="Microsoft.Azure.Graph.RBAC" version="1.9.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Compute" version="11.3.0-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="3.2.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="3.3.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5896.19355-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.0-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.2.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.3.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Compute" version="11.3.0-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="3.2.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="3.3.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.2.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.3.3.0-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
Expand Down Expand Up @@ -227,7 +227,7 @@
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests\TestExpressRouteCircuitCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests\TestExpressRouteCircuitMicrosoftPeeringCRUD.json" >
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests\TestExpressRouteCircuitMicrosoftPeeringCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests\TestExpressRouteCircuitPrivatePublicPeeringCRUD.json">
Expand Down Expand Up @@ -320,6 +320,9 @@
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayConnectionTests\TestVirtualNetworkeExpressRouteGatewayConnectionCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayConnectionTests\TestVirtualNetworkGatewayConnectionWithBgpCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests\TestVirtualNetworkExpressRouteGatewayCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ public void TestVirtualNetworkeExpressRouteGatewayConnectionCRUD()
{
NetworkResourcesController.NewInstance.RunPsTest("Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualNetworkGatewayConnectionWithBgpCRUD()
{
NetworkResourcesController.NewInstance.RunPsTest("Test-VirtualNetworkGatewayConnectionWithBgpCRUD");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,67 @@ function Test-VirtualNetworkeExpressRouteGatewayConnectionCRUD
.SYNOPSIS
Virtual network gateway connection tests
#>
function Test-VirtualNetworkGatewayConnectionWithBgpCRUD
{
# Setup
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$domainNameLabel = Get-ResourceName
$vnetName = Get-ResourceName
$localnetName = Get-ResourceName
$vnetConnectionName = Get-ResourceName
$publicIpName = Get-ResourceName
$vnetGatewayConfigName = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/connections"
$location = Get-ProviderLocation $resourceTypeParent

try
{
# Create the resource group
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Tags @{Name = "testtag"; Value = "testval"}

# Create the Virtual Network
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -AddressPrefix 10.0.0.0/24
$vnet = New-AzureRmvirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet
$vnet = Get-AzureRmvirtualNetwork -Name $vnetName -ResourceGroupName $rgname
$subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $vnet

# Create the publicip
$publicip = New-AzureRmPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel

# Create VirtualNetworkGateway
$vnetIpConfig = New-AzureRmVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet

# Also test overriding the gateway ASN
$actual = New-AzureRmVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -GatewaySku Standard -Asn 55000
$vnetGateway = Get-AzureRmVirtualNetworkGateway -ResourceGroupName $rgname -name $rname
Assert-AreEqual $vnetGateway.BgpSettings.Asn $actual.BgpSettings.Asn

# Create LocalNetworkGateway
$actual = New-AzureRmLocalNetworkGateway -ResourceGroupName $rgname -name $localnetName -location $location -AddressPrefix 192.168.0.0/16 -GatewayIpAddress 192.168.3.10 -Asn 1337 -BgpPeeringAddress "192.168.1.1" -PeerWeight 5
$localnetGateway = Get-AzureRmLocalNetworkGateway -ResourceGroupName $rgname -name $localnetName
Assert-AreEqual $localnetGateway.BgpSettings.Asn $actual.BgpSettings.Asn
Assert-AreEqual $localnetGateway.BgpSettings.BgpPeeringAddress $actual.BgpSettings.BgpPeeringAddress
Assert-AreEqual $localnetGateway.BgpSettings.PeerWeight $actual.BgpSettings.PeerWeight

# Create & Get VirtualNetworkGatewayConnection
$actual = New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName -location $location -VirtualNetworkGateway1 $vnetGateway -LocalNetworkGateway2 $localnetGateway -ConnectionType IPsec -RoutingWeight 3 -SharedKey abc -EnableBgp true
$connection = Get-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName
Assert-AreEqual $connection.EnableBgp $actual.EnableBgp

# Delete VirtualNetworkGatewayConnection
$delete = Remove-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $actual.ResourceGroupName -name $vnetConnectionName -PassThru -Force
Assert-AreEqual true $delete

}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

function Test-VirtualNetworkGatewayConnectionCRUD
{
# Setup
Expand Down
Loading