forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Azure/master
Sync
- Loading branch information
Showing
147 changed files
with
40,883 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
473 changes: 473 additions & 0 deletions
473
src/Network/Network.Test/ScenarioTests/ApplicationGatewayTests.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Commands.Network.Test.ScenarioTests; | ||
using Microsoft.WindowsAzure.Commands.ScenarioTest; | ||
using Xunit; | ||
|
||
namespace Commands.Network.Test.ScenarioTests | ||
{ | ||
public class IpGroupTests : NetworkTestRunner | ||
{ | ||
public IpGroupTests(Xunit.Abstractions.ITestOutputHelper output) | ||
: base(output) | ||
{ | ||
} | ||
|
||
[Fact] | ||
[Trait(Category.AcceptanceType, Category.CheckIn)] | ||
[Trait(Category.Owner, NrpTeamAlias.azurefirewall)] | ||
public void TestIpGroupBasicOperations() | ||
{ | ||
TestRunner.RunTestScript(string.Format("Test-IpGroupsCRUD")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#---------------------------------------------------------------------------------- | ||
|
||
# | ||
# Copyright Microsoft Corporation | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ---------------------------------------------------------------------------------- | ||
|
||
function Check-CmdletReturnType | ||
{ | ||
param($cmdletName, $cmdletReturn) | ||
|
||
$cmdletData = Get-Command $cmdletName | ||
Assert-NotNull $cmdletData | ||
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") } | ||
[array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") } | ||
$realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.","" | ||
return $cmdletReturnTypes -contains $realReturnType | ||
} | ||
|
||
<# | ||
.SYNOPSIS | ||
Test creating new IpGroups | ||
#> | ||
function Test-IpGroupsCRUD | ||
{ | ||
# Setup | ||
$rgname = Get-ResourceGroupName | ||
$rglocation = Get-ProviderLocation ResourceManagement "westus" | ||
$location = Get-ProviderLocation ResourceManagement "westus" | ||
$IpGroupsName = Get-ResourceName | ||
|
||
try | ||
{ | ||
# Create the resource group | ||
New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } | ||
|
||
# Create IpGroup | ||
$actualIpGroup = New-AzIpGroup -ResourceGroupName $rgname -location $location -Name $IpGroupsName -IpAddress 10.0.0.0/24,11.9.0.0/24 | ||
$expectedIpGroup = Get-AzIpGroup -ResourceGroupName $rgname -Name $IpGroupsName | ||
Assert-AreEqual $expectedIpGroup.ResourceGroupName $actualIpGroup.ResourceGroupName | ||
Assert-AreEqual $expectedIpGroup.Name $actualIpGroup.Name | ||
|
||
# Delete IpGroup | ||
$deleteIpGroup = Remove-AzIpGroup -ResourceGroupName $rgname -Name $IpGroupsName -PassThru -Force | ||
Assert-AreEqual true $deleteIpGroup | ||
|
||
} | ||
finally | ||
{ | ||
# Cleanup | ||
Clean-ResourceGroup $rgname | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.