Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new property "FlowTimeout" to Virtual Network #14665

Merged
merged 13 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</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.4.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</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="44.0.0" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.1.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</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.ContainerRegistry" Version="4.0.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0">
<NoWarn>NU1608</NoWarn>
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.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<PackageReference Include="Microsoft.Azure.Management.CosmosDB" Version="2.0.0" />
</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.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</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.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/HDInsight/HDInsight.Test/HDInsight.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.1.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.21.0-preview" />
</ItemGroup>

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="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.0" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions 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.1.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</ItemGroup>

<ItemGroup>
Expand All @@ -26,4 +26,3 @@
</ItemGroup>

</Project>

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.3-preview" />
<PackageReference Include="Microsoft.Azure.Management.ApplicationInsights" Version="0.3.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<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.10.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.3.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
</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.4.0" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="323.1255.27827" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.1.0-preview.2" />
<PackageReference Include="Microsoft.Azure.Insights" Version="0.16.0-preview" />
Expand Down
8 changes: 8 additions & 0 deletions src/Network/Network.Test/ScenarioTests/VirtualNetworkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,13 @@ public void TestVirtualNetworkSubnetServiceEndpointPolicies()
{
TestRunner.RunTestScript("Test-VirtualNetworkSubnetServiceEndpointPolicies");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, NrpTeamAlias.sdnnrp)]
public void TestVirtualNetworkCRUDFlowTimeout()
{
TestRunner.RunTestScript("Test-VirtualNetworkCRUD-FlowTimeout");
}
}
}
51 changes: 51 additions & 0 deletions src/Network/Network.Test/ScenarioTests/VirtualNetworkTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1292,3 +1292,54 @@ function Test-VirtualNetworkSubnetServiceEndpointPolicies
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Tests creating new virtual network with flow timeout.
#>
function Test-VirtualNetworkCRUD-FlowTimeout
{
# Setup
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/virtualNetworks"
$location = Get-ProviderLocation $resourceTypeParent

try
{
# Create the resource group
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }

# Create virtual network
$actual = New-AzVirtualNetwork -ResourceGroupName $rgname -name $rname -location $location -FlowTimeout 15 -AddressPrefix 10.0.0.0/16
$expected = Get-AzVirtualNetwork -ResourceGroupName $rgname -name $rname
Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName
Assert-AreEqual $expected.Name $actual.Name
Assert-AreEqual $expected.Location $actual.Location
Assert-NotNull $expected.ResourceGuid
Assert-AreEqual "Succeeded" $expected.ProvisioningState
Assert-AreEqual 15 $expected.FlowTimeoutInMinutes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Satya-anshu , our pipeline said 'Assertion failed because expected '15' does not match actual '. Could you figure it out?


# Set virtual network
$actual.FlowTimeoutInMinutes = 30
$actual = Set-AzVirtualNetwork -VirtualNetwork $actual
$expected = Get-AzVirtualNetwork -ResourceGroupName $rgname -name $rname
Assert-AreEqual 30 $expected.FlowTimeoutInMinutes

# delete
$delete = Remove-AzVirtualNetwork -ResourceGroupName $actual.ResourceGroupName -Name $rname -PassThru -Force
Assert-AreEqual true $delete

$list = Get-AzVirtualNetwork -ResourceGroupName $actual.ResourceGroupName
Assert-AreEqual 0 @($list).Count

# test error handling
Assert-ThrowsContains { Set-AzVirtualNetwork -VirtualNetwork $actual } "not found";
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
Loading