Skip to content

Commit

Permalink
Merge pull request #12751 from Azure/network-june
Browse files Browse the repository at this point in the history
Network june
  • Loading branch information
dingmeng-xue authored Sep 8, 2020
2 parents c0535c1 + 297d4f4 commit 60f21f3
Show file tree
Hide file tree
Showing 110 changed files with 38,187 additions and 45,239 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# To make sure Network PRs go to the right branch, e.g. network-april
/src/Network/ @number213

/src/Network/ @MikhailTryakhov
/src/Compute/ @bilaakpan-ms @sandido @dkulkarni-ms @haagha @madewithsmiles @MS-syh2qs @grizzlytheodore
2 changes: 1 addition & 1 deletion src/Batch/Batch.Test/Batch.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.Azure.Batch" Version="13.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="11.0.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.CognitiveServices" Version="7.3.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Compute/Compute.Test/Compute.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="38.1.0" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.Test.props" />
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="1.2.1" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.DataLake.Store" Version="2.4.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Dns/Dns.Test/Dns.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Dns" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/HDInsight/HDInsight.Test/HDInsight.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PsModuleName>HDInsight</PsModuleName>
Expand All @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions src/HPCCache/HPCCache.Test/Fixtures/HpcCacheTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Commands.HPCCache.Test.Fixtures
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Azure.Commands.HPCCache.Test.ScenarioTests;
using Microsoft.Azure.Commands.HPCCache.Test.Utilities;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Authorization.Models;
Expand All @@ -26,6 +27,7 @@ namespace Microsoft.Azure.Commands.HPCCache.Test.Fixtures
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Management.StorageCache;
using Microsoft.Azure.Management.StorageCache.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.Azure;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;

Expand Down Expand Up @@ -59,6 +61,7 @@ public HpcCacheTestContext(
[System.Runtime.CompilerServices.CallerMemberName]
string methodName = ".ctor")
{
HttpMockServer.Matcher = HpcCacheController.GetRecordMatcher();
this.mockContext = MockContext.Start(suiteObject, methodName);
this.RegisterSubscriptionForResource("Microsoft.StorageCache");
}
Expand All @@ -73,6 +76,7 @@ public HpcCacheTestContext(
[System.Runtime.CompilerServices.CallerMemberName]
string methodName = ".ctor")
{
HttpMockServer.Matcher = HpcCacheController.GetRecordMatcher();
this.mockContext = MockContext.Start(type.Name, methodName);
this.RegisterSubscriptionForResource("Microsoft.StorageCache");
}
Expand Down
2 changes: 1 addition & 1 deletion src/HPCCache/HPCCache.Test/HPCCache.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.11.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="14.5.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.18.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
</ItemGroup>

Expand Down
33 changes: 21 additions & 12 deletions src/HPCCache/HPCCache.Test/ScenarioTests/HPCCacheController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ public void RunPsTest(XunitTracingInterceptor logger, params string[] scripts)
logger.Information(string.Format("Test method finished: {0}.{1}", callingClassType, mockName));
}

/// <summary>
/// Gets storage management client.
/// </summary>
static public IRecordMatcher GetRecordMatcher()
{
var d = new Dictionary<string, string>
{
{ "Microsoft.Resources", null },
{ "Microsoft.Features", null },
{ "Microsoft.Authorization", null },
{ "Microsoft.Network", null },
};
var providersToIgnore = new Dictionary<string, string>
{
{ "Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01" },
{ "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2017-05-10" },
};
return new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
}

/// <summary>
/// RunPsTestWorkflow.
/// </summary>
Expand All @@ -103,18 +123,7 @@ protected void RunPsTestWorkflow(
Action initialize = null)
{
this.helper.TracingInterceptor = logger;
var d = new Dictionary<string, string>
{
{ "Microsoft.Resources", null },
{ "Microsoft.Features", null },
{ "Microsoft.Authorization", null },
};
var providersToIgnore = new Dictionary<string, string>
{
{ "Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01" },
{ "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2017-05-10" },
};
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
HttpMockServer.Matcher = GetRecordMatcher();
HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");
using (var context = new HpcCacheTestContext(callingClassType, mockName))
{
Expand Down
2 changes: 1 addition & 1 deletion src/KeyVault/KeyVault.Test/KeyVault.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.KeyVault.WebKey" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Monitor.Test/Monitor.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.25.1-preview" />
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.3.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/NetAppFiles/NetAppFiles.Test/NetAppFiles.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.NetApp" Version="1.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Network/Network.Test/Network.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Graph.RBAC" Version="3.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.1.1" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
Expand Down
3 changes: 3 additions & 0 deletions src/Network/Network.Test/NrpTeamAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@ class NrpTeamAlias

// Azure Network IPAM dev team
public const string ipam = "ipamdev";

// Azure Network Billing and Telemetry team
public const string billingandtelemetry = "azurenetworkbilling";
}
}
8 changes: 8 additions & 0 deletions src/Network/Network.Test/ScenarioTests/AzureFirewallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,13 @@ public void TestAzureFirewallVirtualHubMultiPublicIPCRUD()
{
TestRunner.RunTestScript("Test-AzureFirewallVirtualHubMultiPublicIPCRUD");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.azurefirewall)]
public void TestAzureFirewallCRUDWithAllowActiveFTP()
{
TestRunner.RunTestScript("Test-AzureFirewallCRUDAllowActiveFTP");
}
}
}
45 changes: 45 additions & 0 deletions src/Network/Network.Test/ScenarioTests/AzureFirewallTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1515,4 +1515,49 @@ function Test-AzureFirewallVirtualHubMultiPublicIPCRUD {
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Tests AzureFirewall AllowActiveFTP
#>
function Test-AzureFirewallCRUDAllowActiveFTP {
$rgname = Get-ResourceGroupName
$azureFirewallName = Get-ResourceName
$resourceTypeParent = "Microsoft.Network/AzureFirewalls"
$location = Get-ProviderLocation $resourceTypeParent "eastus"

$vnetName = Get-ResourceName
$subnetName = "AzureFirewallSubnet"
$publicIpName = Get-ResourceName

try {
# Create the resource group
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $location

# Create the Virtual Network
$subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.0.0/24
$vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet

# Create public ip
$publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Static -Sku Standard

# Create AzureFirewall
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location -AllowActiveFTP

# Verify
$azFirewall = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname
Assert-AreEqual true $azFirewall.AllowActiveFTP

# Reset the AllowActiveFTP flag
$azFirewall.AllowActiveFTP = $false
Set-AzFirewall -AzureFirewall $azFirewall
$azfw = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname

Assert-AreEqual false $azfw.AllowActiveFTP
}
finally {
# Cleanup
Clean-ResourceGroup $rgname
}
}
18 changes: 17 additions & 1 deletion src/Network/Network.Test/ScenarioTests/CortexTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void TestCortexExpressRouteCRUD()
}

[Fact]
[Trait(Category.RunType, Category.LiveOnly)]
[Trait(Category.AcceptanceType, Category.LiveOnly)]
[Trait(Category.Owner, NrpTeamAlias.brooklynft)]
public void TestCortexDownloadConfig()
{
Expand Down Expand Up @@ -90,5 +90,21 @@ public void TestVHubRouteTableCRUD()
{
TestRunner.RunTestScript("Test-VHubRouteTableCRUD");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.brooklynft)]
public void TestVpnGatewayPacketCapture()
{
TestRunner.RunTestScript("Test-VpnGatewayPacketCapture");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.brooklynft)]
public void TestVpnConnectionPacketCapture()
{
TestRunner.RunTestScript("Test-VpnConnectionPacketCapture");
}
}
}
Loading

0 comments on commit 60f21f3

Please sign in to comment.