Skip to content

Commit 6acbe1c

Browse files
committed
Add Az.Peering to Az
1 parent b8faa9f commit 6acbe1c

File tree

140 files changed

+18138
-0
lines changed

Some content is hidden

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

140 files changed

+18138
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<PsModuleName>Peering</PsModuleName>
5+
</PropertyGroup>
6+
7+
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
8+
9+
<PropertyGroup>
10+
<RootNamespace>Microsoft.Azure.Commands.Peering.Test.ScenarioTests</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.PowerShell.Cmdlets.Peering.Test</AssemblyName>
12+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.Azure.Management.Peering" Version="0.9.0-preview" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\Peering\Peering.csproj" />
21+
</ItemGroup>
22+
23+
</Project>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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.Reflection;
16+
using System.Runtime.InteropServices;
17+
using Xunit;
18+
19+
// General Information about an assembly is controlled through the following
20+
// set of attributes. Change these attribute values to modify the information
21+
// associated with an assembly.
22+
[assembly: AssemblyTitle("Microsoft.Azure.Commands.Peering.Test")]
23+
[assembly: AssemblyDescription("")]
24+
[assembly: AssemblyConfiguration("")]
25+
[assembly: AssemblyCompany("")]
26+
[assembly: AssemblyProduct("Microsoft.Azure.Commands.Peering.Test")]
27+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
28+
[assembly: AssemblyTrademark("")]
29+
[assembly: AssemblyCulture("")]
30+
31+
// Setting ComVisible to false makes the types in this assembly not visible
32+
// to COM components. If you need to access a type in this assembly from
33+
// COM, set the ComVisible attribute to true on that type.
34+
[assembly: ComVisible(false)]
35+
36+
// The following GUID is for the ID of the typelib if this project is exposed to COM
37+
[assembly: Guid("2E2C5449-6A82-4462-9BF6-D2F9576CB65E")]
38+
39+
// Version information for an assembly consists of the following four values:
40+
//
41+
// Major Version
42+
// Minor Version
43+
// Build Number
44+
// Revision
45+
//
46+
// You can specify all the values or you can default the Build and Revision Numbers
47+
// by using the '*' as shown below:
48+
[assembly: AssemblyVersion("1.0.0")]
49+
[assembly: AssemblyFileVersion("1.0.0")]
50+
[assembly: CollectionBehavior(DisableTestParallelization = true)]
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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+
Gets valid resource group name
18+
#>
19+
function Get-ResourceGroupName
20+
{
21+
return getAssetName
22+
}
23+
24+
<#
25+
.SYNOPSIS
26+
Gets valid resource name
27+
#>
28+
function Get-ResourceName
29+
{
30+
return getAssetName
31+
}
32+
33+
<#
34+
.SYNOPSIS
35+
Gets the default location for a provider
36+
#>
37+
function Get-ProviderLocation($provider)
38+
{
39+
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
40+
{
41+
$namespace = $provider.Split("/")[0]
42+
if($provider.Contains("/"))
43+
{
44+
$type = $provider.Substring($namespace.Length + 1)
45+
$location = Get-AzResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
46+
47+
if ($location -eq $null)
48+
{
49+
return "West US"
50+
} else
51+
{
52+
return $location.Locations[0]
53+
}
54+
}
55+
56+
return "West US"
57+
}
58+
59+
return "WestUS"
60+
}
61+
62+
<#
63+
.SYNOPSIS
64+
Creates a resource group to use in tests
65+
#>
66+
function TestSetup-CreateResourceGroup
67+
{
68+
$resourceGroupName = getAssetName
69+
$rglocation = Get-ProviderLocation "Central US"
70+
$resourceGroup = New-AzResourceGroup -Name $resourceGroupName -location $rglocation -Force
71+
return $resourceGroup
72+
}
73+
74+
<#
75+
.SYNOPSIS
76+
Asserts if two tags are equal
77+
#>
78+
function Assert-Tags($tags1, $tags2)
79+
{
80+
if($tags1.count -ne $tags2.count)
81+
{
82+
throw "Tag size not equal. Tag1: $tags1.count Tag2: $tags2.count"
83+
}
84+
85+
foreach($key in $tags1.Keys)
86+
{
87+
if($tags1[$key] -ne $tags2[$key])
88+
{
89+
throw "Tag content not equal. Key:$key Tags1:" + $tags1[$key] + "Tags2:" + $tags2[$key]
90+
}
91+
}
92+
}
93+
94+
<#
95+
.SYNOPSIS
96+
Asserts if two compression types are equal
97+
#>
98+
function Assert-CompressionTypes($types1, $types2)
99+
{
100+
if($types1.Count -ne $types1.Count)
101+
{
102+
throw "Array size not equal. Types1: $types1.count Types2: $types2.count"
103+
}
104+
105+
foreach($value1 in $types1)
106+
{
107+
$found = $false
108+
foreach($value2 in $types2)
109+
{
110+
if($value1.CompareTo($value2) -eq 0)
111+
{
112+
$found = $true
113+
break
114+
}
115+
}
116+
if(-Not($found))
117+
{
118+
throw "Compression content not equal. " + $value1 + " cannot be found in second array"
119+
}
120+
}
121+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
namespace Microsoft.Azure.Commands.Peering.Test.ScenarioTests.ScenarioTests
16+
{
17+
using System;
18+
19+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
20+
21+
using Xunit;
22+
23+
public class CreateNewDirectConnectionTests
24+
{
25+
private ServiceManagement.Common.Models.XunitTracingInterceptor _logger;
26+
27+
public CreateNewDirectConnectionTests(Xunit.Abstractions.ITestOutputHelper output)
28+
{
29+
this._logger = new ServiceManagement.Common.Models.XunitTracingInterceptor(output);
30+
ServiceManagement.Common.Models.XunitTracingInterceptor.AddToContext(this._logger);
31+
// Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
32+
}
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
public void TestNewDirectConnectionWithV4V6()
36+
{
37+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionWithV4V6");
38+
}
39+
40+
[Fact]
41+
[Trait(Category.AcceptanceType, Category.CheckIn)]
42+
public void TestNewDirectConnectionWithV4()
43+
{
44+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionWithV4");
45+
}
46+
47+
[Fact]
48+
[Trait(Category.AcceptanceType, Category.CheckIn)]
49+
public void TestNewDirectConnectionWithV6()
50+
{
51+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionWithV6");
52+
}
53+
54+
[Fact]
55+
[Trait(Category.AcceptanceType, Category.CheckIn)]
56+
public void TestNewDirectConnectionHighBandwidth()
57+
{
58+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionHighBandwidth");
59+
}
60+
61+
[Fact]
62+
[Trait(Category.AcceptanceType, Category.CheckIn)]
63+
public void TestNewDirectConnectionLowBandwidth()
64+
{
65+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionLowBandwidth");
66+
}
67+
68+
[Fact]
69+
[Trait(Category.AcceptanceType, Category.CheckIn)]
70+
public void TestNewDirectConnectionWrongV6()
71+
{
72+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionWrongV6");
73+
}
74+
75+
[Fact]
76+
[Trait(Category.AcceptanceType, Category.CheckIn)]
77+
public void TestNewDirectConnectionWrongV4()
78+
{
79+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionWrongV4");
80+
}
81+
82+
[Fact]
83+
[Trait(Category.AcceptanceType, Category.CheckIn)]
84+
public void TestNewDirectConnectionNoSession()
85+
{
86+
TestController.NewInstance.RunPowerShellTest(this._logger, "Test-NewDirectConnectionNoSession");
87+
}
88+
89+
90+
}
91+
}

0 commit comments

Comments
 (0)