Skip to content

Commit dedc5dc

Browse files
Enable effective routes/nsg test
1 parent 6038f7d commit dedc5dc

File tree

4 files changed

+5070
-3
lines changed

4 files changed

+5070
-3
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@
397397
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestAddNetworkInterface.json">
398398
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
399399
</None>
400+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestEffectiveRoutesAndNsg.json">
401+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
402+
</None>
400403
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests\TestSingleNetworkInterfaceDnsSettings.json">
401404
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
402405
</None>

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void TestAddNetworkInterface()
5353
}
5454

5555

56-
[Fact(Skip ="to be recorded after fixing compute test proj")]
56+
[Fact]
5757
[Trait(Category.AcceptanceType, Category.CheckIn)]
5858
public void TestEffectiveRoutesAndNsg()
5959
{

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,19 @@ function Test-EffectiveRoutesAndNsg
578578
Assert-AreEqual $getnic.Primary true;
579579
Assert-NotNull $getnic.MacAddress;
580580

581-
# Get Effective route
581+
# Get Effective route by name
582582
$effectiveRoute = Get-AzureRmEffectiveRouteTable -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
583+
Assert-NotNull $effectiveRoute[0].Source
583584

584-
# Get Effective NSG
585+
# Get Effective NSG by name
585586
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
587+
588+
# Get Effective route by object
589+
$effectiveRoute = Get-AzureRmEffectiveRouteTable -NetworkInterface $getnic
590+
Assert-NotNull $effectiveRoute[0].Source
591+
592+
# Get Effective NSG by object
593+
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -NetworkInterface $getnic
586594

587595
}
588596
finally

0 commit comments

Comments
 (0)