Skip to content

Commit

Permalink
Merge pull request #618 from DeepakRajendranMsft/RouteNextHopTypeFix
Browse files Browse the repository at this point in the history
RouteNextHopTypeFix
  • Loading branch information
markcowl committed Jul 16, 2015
2 parents 6d80faf + 009e568 commit 5ead947
Show file tree
Hide file tree
Showing 12 changed files with 1,149 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.8-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.9-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.19.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Compute" version="7.0.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5571.32271-prerelease" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.8-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.9-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.19.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Compute" version="7.0.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Storage" version="2.4.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.19.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.8-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.9-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -194,7 +194,8 @@
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ApplicationGatewayTests\TestApplicationGatewayCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> <None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestCreateEmptyLoadBalancer.json">
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestCreateEmptyLoadBalancer.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.LoadBalancerTests\TestLoadBalancerCRUDInternalDynamic.json">
Expand Down Expand Up @@ -257,6 +258,9 @@
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.RouteTableTests\TestEmptyRouteTable.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.RouteTableTests\TestRouteHopTypeTest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.RouteTableTests\TestRouteTableCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ public void TestRouteTableRouteCRUD()
NetworkResourcesController.NewInstance.RunPsTest("Test-RouteTableRouteCRUD");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRouteHopTypeTest()
{
NetworkResourcesController.NewInstance.RunPsTest("Test-RouteHopTypeTest");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,64 @@ function Test-RouteTableRouteCRUD
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Tests RouteTable Hoptype Test
#>
function Test-RouteHopTypeTest
{
# Setup
$rgname = Get-ResourceGroupName
$routeTableName = Get-ResourceName
$vnetName = Get-ResourceName
$subnetName = Get-ResourceName
$domainNameLabel = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/routeTables"
$location = Get-ProviderLocation $resourceTypeParent

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

$route1 = New-AzureRouteConfig -name "route1" -AddressPrefix "192.168.1.0/24" -NextHopIpAddress "23.108.1.1" -NextHopType "VirtualAppliance"
$route2 = New-AzureRouteConfig -name "route2" -AddressPrefix "10.0.1.0/24" -NextHopType "VnetLocal"
$route3 = New-AzureRouteConfig -name "route3" -AddressPrefix "0.0.0.0/0" -NextHopType "Internet"
$route4 = New-AzureRouteConfig -name "route4" -AddressPrefix "10.0.2.0/24" -NextHopType "None"

# Create RouteTable
$rt = New-AzureRouteTable -name $routeTableName -ResourceGroupName $rgname -Location $location -Route $route1, $route2, $route3, $route4

# Get RouteTable
$getRT = Get-AzureRouteTable -name $routeTableName -ResourceGroupName $rgName

#verification
Assert-AreEqual $rgName $getRT.ResourceGroupName
Assert-AreEqual $routeTableName $getRT.Name
Assert-NotNull $getRT.Etag
Assert-AreEqual 4 @($getRT.Routes).Count
Assert-AreEqual $getRT.Routes[0].Name "route1"
Assert-AreEqual $getRT.Routes[0].NextHopType "VirtualAppliance"
Assert-AreEqual $getRT.Routes[1].Name "route2"
Assert-AreEqual $getRT.Routes[1].NextHopType "VnetLocal"
Assert-AreEqual $getRT.Routes[2].Name "route3"
Assert-AreEqual $getRT.Routes[2].NextHopType "Internet"
Assert-AreEqual $getRT.Routes[3].Name "route4"
Assert-AreEqual $getRT.Routes[3].NextHopType "None"

# Delete RouteTable
$delete = Remove-AzureRouteTable -ResourceGroupName $rgname -name $routeTableName -PassThru -Force
Assert-AreEqual true $delete

$list = Get-AzureRouteTable -ResourceGroupName $rgname
Assert-AreEqual 0 @($list).Count
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.19.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.1-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5571.32271-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5571.32271-prerelease" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.19.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.8-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.9-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -224,7 +224,8 @@
<Compile Include="RouteTable\Route\NewAzureRouteConfigCommand.cs" />
<Compile Include="RouteTable\Route\RemoveAzureRouteConfigCommand.cs" />
<Compile Include="RouteTable\Route\SetAzureRouteConfigCommand.cs" />
<Compile Include="RouteTable\SetAzureRouteTableCommand.cs" /> <Compile Include="VirtualNetworkGateway\ChildResourceHelp.cs" />
<Compile Include="RouteTable\SetAzureRouteTableCommand.cs" />
<Compile Include="VirtualNetworkGateway\ChildResourceHelp.cs" />
<Compile Include="VirtualNetworkGateway\VirtualNetworkGatewayBaseCmdlet.cs" />
<Compile Include="VirtualNetworkGateway\GetAzureVirtualNetworkGatewayCommand.cs" />
<Compile Include="VirtualNetworkGateway\NewAzureVirtualNetworkGatewayCommand.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class AzureRouteConfigBase : NetworkBaseCmdlet
HelpMessage = "The type of Azure hop the packet should be sent to.")]
[ValidateSet(
MNM.RouteNextHopType.Internet,
MNM.RouteNextHopType.Null,
MNM.RouteNextHopType.None,
MNM.RouteNextHopType.VirtualAppliance,
MNM.RouteNextHopType.VirtualNetworkGateway,
MNM.RouteNextHopType.VnetLocal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="0.19.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.8-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Network" version="2.0.9-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.1-preview" 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

0 comments on commit 5ead947

Please sign in to comment.