Skip to content

Commit 832c591

Browse files
authored
Merge pull request Azure#4880 from irrogozh/preview
Added ReachabilityProviderList and ReachabilityReport cmdlets + tests
2 parents e35fdf3 + b577c31 commit 832c591

28 files changed

+4660
-10
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
<Reference Include="Microsoft.Azure.Management.Compute">
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.16.3.0\lib\net452\Microsoft.Azure.Management.Compute.dll</HintPath>
6868
</Reference>
69-
<Reference Include="Microsoft.Azure.Management.Network, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.15.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
69+
<Reference Include="Microsoft.Azure.Management.Network, Version=15.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.15.1.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
7171
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.Management.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/ResourceManager/Compute/Commands.Compute.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="Microsoft.Azure.Graph.RBAC" version="3.4.0-preview" targetFramework="net452" />
88
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Compute" version="16.3.0" targetFramework="net452" />
10-
<package id="Microsoft.Azure.Management.Network" version="15.0.0-preview" targetFramework="net452" />
10+
<package id="Microsoft.Azure.Management.Network" version="15.1.0-preview" targetFramework="net452" />
1111
<package id="Microsoft.Azure.Management.Storage" version="4.1.0-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" />

src/ResourceManager/Network/AzureRM.Network.psd1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ CmdletsToExport = 'Add-AzureRmApplicationGatewayAuthenticationCertificate',
201201
'Get-AzureRmNetworkWatcherFlowLogStatus',
202202
'Set-AzureRmNetworkWatcherConfigFlowLog',
203203
'Test-AzureRmNetworkWatcherConnectivity',
204+
'Get-AzureRmNetworkWatcherReachabilityReport',
205+
'Get-AzureRmNetworkWatcherReachabilityProvidersList',
204206
'Get-AzureRmExpressRouteServiceProvider',
205207
'Test-AzureRmPrivateIPAddressAvailability',
206208
'Get-AzureRmPublicIpAddress', 'New-AzureRmPublicIpAddress',

src/ResourceManager/Network/ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21-
21+
* Added cmdlet to list available internet service providers for a specified Azure region
22+
- Get-AzureRmNetworkWatcherReachabilityProvidersList
23+
* Added cmdlet to get the relative latency score for internet service providers from a specified location to Azure regions
24+
- Get-AzureRmNetworkWatcherReachabilityReport
25+
2226
## Version 4.4.1
2327

2428
## Version 4.4.0

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6565
<Private>True</Private>
6666
</Reference>
67-
<Reference Include="Microsoft.Azure.Management.Network, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.15.0.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
67+
<Reference Include="Microsoft.Azure.Management.Network, Version=15.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.15.1.0-preview\lib\net452\Microsoft.Azure.Management.Network.dll</HintPath>
6969
<Private>True</Private>
7070
</Reference>
7171
<Reference Include="Microsoft.Azure.Management.ResourceManager">
@@ -350,6 +350,12 @@
350350
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkWatcherAPITests\TestGetTopology.json">
351351
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
352352
</None>
353+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkWatcherAPITests\TestProvidersList.json">
354+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
355+
</None>
356+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkWatcherAPITests\TestReachabilityReport.json">
357+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
358+
</None>
353359
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.ApplicationGatewayTests\TestApplicationGatewayCRUD.json">
354360
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
355361
</None>

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/NetworkWatcherAPITests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,19 @@ public void TestConnectivityCheck()
8181
{
8282
NetworkResourcesController.NewInstance.RunPsTest("Test-ConnectivityCheck");
8383
}
84+
85+
[Fact]
86+
[Trait(Category.AcceptanceType, Category.CheckIn)]
87+
public void TestReachabilityReport()
88+
{
89+
NetworkResourcesController.NewInstance.RunPsTest("Test-ReachabilityReport");
90+
}
91+
92+
[Fact]
93+
[Trait(Category.AcceptanceType, Category.CheckIn)]
94+
public void TestProvidersList()
95+
{
96+
NetworkResourcesController.NewInstance.RunPsTest("Test-ProvidersList");
97+
}
8498
}
8599
}

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

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,4 +618,85 @@ function Test-ConnectivityCheck
618618
}
619619
}
620620

621+
<#
622+
.SYNOPSIS
623+
Test ReachabilityReport NetworkWatcher API.
624+
#>
625+
function Test-ReachabilityReport
626+
{
627+
# Setup
628+
$rgname = Get-ResourceGroupName
629+
$nwName = Get-ResourceName
630+
$rglocation = Get-ProviderLocation ResourceManagement
631+
$resourceTypeParent = "Microsoft.Network/networkWatchers"
632+
$location = "westcentralus"
633+
634+
try
635+
{
636+
# Create the resource group
637+
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
638+
639+
# Create the Network Watcher
640+
$tags = @{"key1" = "value1"; "key2" = "value2"}
641+
$nw = New-AzureRmNetworkWatcher -Name $nwName -ResourceGroupName $rgname -Location $location -Tag $tags
642+
643+
$report1 = Get-AzureRmNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -StartTime "2017-10-05" -EndTime "2017-10-10"
644+
$report2 = Get-AzureRmNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -StartTime "2017-10-05" -EndTime "2017-10-10"
645+
$report3 = Get-AzureRmNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -City "seattle" -StartTime "2017-10-05" -EndTime "2017-10-10"
646+
647+
Assert-AreEqual $report1.AggregationLevel "Country"
648+
Assert-AreEqual $report1.ProviderLocation.Country "United States"
649+
Assert-AreEqual $report2.AggregationLevel "State"
650+
Assert-AreEqual $report2.ProviderLocation.Country "United States"
651+
Assert-AreEqual $report2.ProviderLocation.State "washington"
652+
Assert-AreEqual $report3.AggregationLevel "City"
653+
Assert-AreEqual $report3.ProviderLocation.Country "United States"
654+
Assert-AreEqual $report3.ProviderLocation.State "washington"
655+
Assert-AreEqual $report3.ProviderLocation.City "seattle"
656+
}
657+
finally
658+
{
659+
# Cleanup
660+
Clean-ResourceGroup $rgname
661+
}
662+
}
621663

664+
<#
665+
.SYNOPSIS
666+
Test ProvidersList NetworkWatcher API.
667+
#>
668+
function Test-ProvidersList
669+
{
670+
# Setup
671+
$rgname = Get-ResourceGroupName
672+
$nwName = Get-ResourceName
673+
$rglocation = Get-ProviderLocation ResourceManagement
674+
$resourceTypeParent = "Microsoft.Network/networkWatchers"
675+
$location = "westcentralus"
676+
677+
try
678+
{
679+
# Create the resource group
680+
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
681+
682+
# Create the Network Watcher
683+
$tags = @{"key1" = "value1"; "key2" = "value2"}
684+
$nw = New-AzureRmNetworkWatcher -Name $nwName -ResourceGroupName $rgname -Location $location -Tag $tags
685+
686+
$list1 = Get-AzureRmNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States"
687+
$list2 = Get-AzureRmNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington"
688+
$list3 = Get-AzureRmNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -City "seattle"
689+
690+
Assert-AreEqual $list1.Countries.CountryName "United States"
691+
Assert-AreEqual $list2.Countries.CountryName "United States"
692+
Assert-AreEqual $list2.Countries.States.StateName "washington"
693+
Assert-AreEqual $list3.Countries.CountryName "United States"
694+
Assert-AreEqual $list3.Countries.States.StateName "washington"
695+
Assert-AreEqual $list3.Countries.States.Cities.CityName "seattle"
696+
}
697+
finally
698+
{
699+
# Cleanup
700+
Clean-ResourceGroup $rgname
701+
}
702+
}

0 commit comments

Comments
 (0)