Skip to content

Commit 2be77d8

Browse files
authored
Merge branch 'master' into removeDeprecatedVaAliases
2 parents 5fbc757 + 5127415 commit 2be77d8

File tree

117 files changed

+36484
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+36484
-595
lines changed

src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,21 @@ public void TestApplicationGatewayCRUDRewriteRuleSetWithConditions()
105105
{
106106
TestRunner.RunTestScript(string.Format("Test-ApplicationGatewayCRUDRewriteRuleSetWithConditions -baseDir '{0}'", AppDomain.CurrentDomain.BaseDirectory));
107107
}
108+
109+
[Fact]
110+
[Trait(Category.AcceptanceType, Category.CheckIn)]
111+
[Trait(Category.Owner, NrpTeamAlias.nvadev)]
112+
public void TestTopLevelWafResourceWithApplicationGateway()
113+
{
114+
TestRunner.RunTestScript(string.Format("Test-ApplicationGatewayTopLevelFirewallPolicy -baseDir '{0}'", AppDomain.CurrentDomain.BaseDirectory));
115+
}
116+
117+
[Fact]
118+
[Trait(Category.AcceptanceType, Category.CheckIn)]
119+
[Trait(Category.Owner, NrpTeamAlias.nvadev)]
120+
public void TestApplicationGatewayWithFirewallPolicy()
121+
{
122+
TestRunner.RunTestScript(string.Format("Test-ApplicationGatewayWithFirewallPolicy -baseDir '{0}'", AppDomain.CurrentDomain.BaseDirectory));
123+
}
108124
}
109125
}

src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1

Lines changed: 473 additions & 0 deletions
Large diffs are not rendered by default.
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+
using Microsoft.Azure.Commands.Network.Test.ScenarioTests;
16+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
17+
using Xunit;
18+
19+
namespace Commands.Network.Test.ScenarioTests
20+
{
21+
public class IpGroupTests : NetworkTestRunner
22+
{
23+
public IpGroupTests(Xunit.Abstractions.ITestOutputHelper output)
24+
: base(output)
25+
{
26+
}
27+
28+
[Fact]
29+
[Trait(Category.AcceptanceType, Category.CheckIn)]
30+
[Trait(Category.Owner, NrpTeamAlias.azurefirewall)]
31+
public void TestIpGroupBasicOperations()
32+
{
33+
TestRunner.RunTestScript(string.Format("Test-IpGroupsCRUD"));
34+
}
35+
}
36+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#----------------------------------------------------------------------------------
2+
3+
#
4+
# Copyright Microsoft Corporation
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ----------------------------------------------------------------------------------
15+
16+
function Check-CmdletReturnType
17+
{
18+
param($cmdletName, $cmdletReturn)
19+
20+
$cmdletData = Get-Command $cmdletName
21+
Assert-NotNull $cmdletData
22+
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }
23+
[array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") }
24+
$realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.",""
25+
return $cmdletReturnTypes -contains $realReturnType
26+
}
27+
28+
<#
29+
.SYNOPSIS
30+
Test creating new IpGroups
31+
#>
32+
function Test-IpGroupsCRUD
33+
{
34+
# Setup
35+
$rgname = Get-ResourceGroupName
36+
$rglocation = Get-ProviderLocation ResourceManagement "westus"
37+
$location = Get-ProviderLocation ResourceManagement "westus"
38+
$IpGroupsName = Get-ResourceName
39+
40+
try
41+
{
42+
# Create the resource group
43+
New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
44+
45+
# Create IpGroup
46+
$actualIpGroup = New-AzIpGroup -ResourceGroupName $rgname -location $location -Name $IpGroupsName -IpAddress 10.0.0.0/24,11.9.0.0/24
47+
$expectedIpGroup = Get-AzIpGroup -ResourceGroupName $rgname -Name $IpGroupsName
48+
Assert-AreEqual $expectedIpGroup.ResourceGroupName $actualIpGroup.ResourceGroupName
49+
Assert-AreEqual $expectedIpGroup.Name $actualIpGroup.Name
50+
51+
# Delete IpGroup
52+
$deleteIpGroup = Remove-AzIpGroup -ResourceGroupName $rgname -Name $IpGroupsName -PassThru -Force
53+
Assert-AreEqual true $deleteIpGroup
54+
55+
}
56+
finally
57+
{
58+
# Cleanup
59+
Clean-ResourceGroup $rgname
60+
}
61+
}

0 commit comments

Comments
 (0)