Skip to content

Commit 84d46ff

Browse files
Merge branch 'network-october-release' into local-october
# Conflicts: # src/ResourceManager/Compute.ManagedService/Commands.Compute.ManagedService.Test/Commands.Compute.ManagedService.Test.Netcore.csproj # src/ResourceManager/Compute.ManagedService/Commands.Compute.ManagedService.Test/Commands.Compute.ManagedService.Test.csproj # src/ResourceManager/Compute.ManagedService/Commands.Compute.ManagedService.Test/packages.config # src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.Netcore.csproj # src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj # src/ResourceManager/Compute/Commands.Compute.Test/packages.config # src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Commands.DataLakeStore.Test.Netcore.csproj # src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/Commands.DataLakeStore.Test.csproj # src/ResourceManager/Dns/Commands.Dns.Test/Commands.Dns.Test.Netcore.csproj # src/ResourceManager/Dns/Commands.Dns.Test/Commands.Dns.Test.csproj # src/ResourceManager/Dns/Commands.Dns.Test/packages.config # src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.Netcore.csproj # src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj # src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config # src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.Netcore.csproj # src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj # src/ResourceManager/Network/Commands.Network.Test/packages.config # src/ResourceManager/Network/Commands.Network/ChangeLog.md # src/ResourceManager/Network/Commands.Network/Commands.Network.Netcore.csproj # src/ResourceManager/Network/Commands.Network/Commands.Network.csproj # src/ResourceManager/Network/Commands.Network/packages.config # src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup.Test/Commands.RecoveryServices.Backup.Test.Netcore.csproj # src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup.Test/Commands.RecoveryServices.Backup.Test.csproj # src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup.Test/packages.config # src/ResourceManager/ServiceFabric/Commands.ServiceFabric.Test/packages.config # src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.Netcore.csproj # src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj # src/ResourceManager/Sql/Commands.Sql.Test/packages.config
2 parents 7028b85 + 0e40109 commit 84d46ff

File tree

39 files changed

+4854
-516
lines changed

39 files changed

+4854
-516
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
2727
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
2828
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
29-
</packages>
29+
</packages>
30+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19+
using Xunit;
20+
using Xunit.Abstractions;
21+
22+
namespace Commands.Network.Test.ScenarioTests
23+
{
24+
public class ExpressRoutePortTests : RMTestBase
25+
{
26+
public XunitTracingInterceptor _logger;
27+
public ExpressRoutePortTests(Xunit.Abstractions.ITestOutputHelper output)
28+
{
29+
_logger = new XunitTracingInterceptor(output);
30+
XunitTracingInterceptor.AddToContext(_logger);
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
[Trait(Category.Owner, Category.pgtm)]
36+
public void TestExpressRoutePortCRUDMinimalParameters()
37+
{
38+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-ExpressRoutePortCRUD"));
39+
}
40+
}
41+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
function Check-CmdletReturnType
16+
{
17+
param($cmdletName, $cmdletReturn)
18+
19+
$cmdletData = Get-Command $cmdletName
20+
Assert-NotNull $cmdletData
21+
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }
22+
[array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") }
23+
$realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.",""
24+
return $cmdletReturnTypes -contains $realReturnType
25+
}
26+
27+
<#
28+
.SYNOPSIS
29+
Test creating new ExpressRoutePort
30+
#>
31+
function Test-ExpressRoutePortCRUD
32+
{
33+
# Setup
34+
$rgname = Get-ResourceGroupName
35+
$rglocation = Get-ProviderLocation ResourceManagement
36+
$rname = Get-ResourceName
37+
$resourceTypeParent = "Microsoft.Network/expressRoutePorts"
38+
$location = Get-ProviderLocation $resourceTypeParent
39+
$peeringLocation = "Cheyenne-ERDirect"
40+
$encapsulation = "QinQ"
41+
$bandwidthInGbps = 100.0
42+
43+
try
44+
{
45+
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation
46+
47+
# Create ExpressRoutePort
48+
$vExpressRoutePort = New-AzureRmExpressRoutePort -ResourceGroupName $rgname -Name $rname -Location $location -PeeringLocation $peeringLocation -Encapsulation $encapsulation -BandwidthInGbps $bandwidthInGbps
49+
Assert-NotNull $vExpressRoutePort
50+
Assert-True { Check-CmdletReturnType "New-AzureRmExpressRoutePort" $vExpressRoutePort }
51+
Assert-NotNull $vExpressRoutePort.Links
52+
Assert-True { $vExpressRoutePort.Links.Count -eq 2 }
53+
Assert-AreEqual $rname $vExpressRoutePort.Name
54+
55+
# Get ExpressRoutePort
56+
$vExpressRoutePort = Get-AzureRmExpressRoutePort -ResourceGroupName $rgname -Name $rname
57+
Assert-NotNull $vExpressRoutePort
58+
Assert-True { Check-CmdletReturnType "Get-AzureRmExpressRoutePort" $vExpressRoutePort }
59+
Assert-AreEqual $rname $vExpressRoutePort.Name
60+
61+
# Update ExpressRoutePort
62+
$vExpressRoutePort.Links[0].AdminState = "Enabled"
63+
Set-AzureRmExpressRoutePort -ExpressRoutePort $vExpressRoutePort
64+
65+
# Get ExpressRouteLink
66+
$vExpressRouteLink = $vExpressRoutePort | Get-AzureRmExpressRoutePortLinkConfig -Name "Link1"
67+
Assert-NotNull $vExpressRouteLink;
68+
Assert-AreEqual $vExpressRouteLink.AdminState "Enabled"
69+
70+
# List ExpressRouteLinks
71+
$vExpressRouteLinksList = $vExpressRoutePort | Get-AzureRmExpressRoutePortLinkConfig
72+
Assert-True { $vExpressRouteLinksList.Count -eq 2 }
73+
74+
# Remove ExpressRoutePort
75+
$removeExpressRoutePort = Remove-AzureRmExpressRoutePort -ResourceGroupName $rgname -Name $rname -PassThru -Force
76+
Assert-AreEqual $true $removeExpressRoutePort
77+
}
78+
finally
79+
{
80+
# Cleanup
81+
Clean-ResourceGroup $rgname
82+
}
83+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19+
using Xunit;
20+
using Xunit.Abstractions;
21+
22+
namespace Commands.Network.Test.ScenarioTests
23+
{
24+
public class ExpressRoutePortsLocationTests : RMTestBase
25+
{
26+
public XunitTracingInterceptor _logger;
27+
public ExpressRoutePortsLocationTests(Xunit.Abstractions.ITestOutputHelper output)
28+
{
29+
_logger = new XunitTracingInterceptor(output);
30+
XunitTracingInterceptor.AddToContext(_logger);
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
[Trait(Category.Owner, Category.pgtm)]
36+
public void TestExpressRoutePortsLocationRead()
37+
{
38+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-ExpressRoutePortsLocationRead"));
39+
}
40+
}
41+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Test ExpressRoutePortsLocation
18+
#>
19+
function Test-ExpressRoutePortsLocationRead
20+
{
21+
$vExpressRoutePortsLocationList = Get-AzureRmExpressRoutePortsLocation
22+
Assert-NotNull $vExpressRoutePortsLocationList
23+
Assert-True { $vExpressRoutePortsLocationList.Count -eq 6 }
24+
Assert-NotNull $vExpressRoutePortsLocationList[0].Address
25+
Assert-NotNull $vExpressRoutePortsLocationList[0].Contact
26+
Assert-NotNull $vExpressRoutePortsLocationList[0].AvailableBandwidths
27+
Assert-True { $vExpressRoutePortsLocationList[0].AvailableBandwidths.Count -eq 0 }
28+
29+
# Get details of a location
30+
$vExpressRoutePortsLocation = Get-AzureRmExpressRoutePortsLocation -LocationName "Cheyenne-ERDirect"
31+
Assert-NotNull $vExpressRoutePortsLocation
32+
Assert-NotNull $vExpressRoutePortsLocation.Address
33+
Assert-NotNull $vExpressRoutePortsLocation.Contact
34+
Assert-NotNull $vExpressRoutePortsLocation.AvailableBandwidths
35+
Assert-True { $vExpressRoutePortsLocation.AvailableBandwidths.Count -eq 1 }
36+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,10 @@ function Test-ConnectivityCheck
698698
}
699699
finally
700700
{
701+
Assert-ThrowsContains { Test-AzureRmNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationId $vm.Id -DestinationPort 80 } "Connectivity check destination resource id must not be the same as source";
702+
Assert-ThrowsContains { Test-AzureRmNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationPort 80 } "Connectivity check missing destination resource id or address";
703+
Assert-ThrowsContains { Test-AzureRmNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationAddress "bing.com" } "Connectivity check missing destination port";
704+
701705
# Cleanup
702706
Clean-ResourceGroup $resourceGroupName
703707
Clean-ResourceGroup $nwRgName

0 commit comments

Comments
 (0)