Skip to content

Commit 6cffcaa

Browse files
authored
Merge pull request Azure#3009 from DeepakRajendranMsft/release-3.0.0
[needs re-targeting to dev branch] Add Source property to EffectiveRoute and add warning if no response from GetEffectiveNSG
2 parents caa0df9 + 89fe368 commit 6cffcaa

File tree

8 files changed

+5084
-5
lines changed

8 files changed

+5084
-5
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,12 @@ 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-
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
586-
585+
# Get Effective NSG by name
586+
$effectiveNsgs = Get-AzureRmEffectiveNetworkSecurityGroup -ResourceGroupName $rgname -NetworkInterfaceName $getnic.Name
587587
}
588588
finally
589589
{

src/ResourceManager/Compute/Commands.Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineNetworkInterfaceTests/TestEffectiveRoutesAndNsg.json

Lines changed: 5056 additions & 0 deletions
Large diffs are not rendered by default.

src/ResourceManager/Network/Commands.Network/Models/PSEffectiveRoute.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public class PSEffectiveRoute
2626
[JsonProperty(Order = 1)]
2727
public string State { get; set; }
2828

29+
[JsonProperty(Order = 1)]
30+
public string Source { get; set; }
31+
2932
[JsonProperty(Order = 1)]
3033
public List<string> AddressPrefix { get; set; }
3134

src/ResourceManager/Network/Commands.Network/NetworkInterface/EffectiveResources/GetAzureEffectiveNetworkSecurityGroupCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public override void Execute()
4646
var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs.Value);
4747

4848
WriteObject(psEffectiveNsgs, true);
49+
50+
if (psEffectiveNsgs.Count == 0)
51+
{
52+
WriteWarning(Microsoft.Azure.Commands.Network.Properties.Resources.EmptyEffectiveNetworkSecurityGroupOnNic);
53+
}
4954
}
5055
}
5156
}

src/ResourceManager/Network/Commands.Network/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Network/Commands.Network/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,7 @@
255255
<data name="UltraPerformanceGatewayWarningMessage" xml:space="preserve">
256256
<value>Please check the availability of UltraPerformance gateway on https://azure.microsoft.com/en-us/documentation/articles/expressroute-about-virtual-network-gateways/. You will be billed for this gateway once this command succeeds.</value>
257257
</data>
258+
<data name="EmptyEffectiveNetworkSecurityGroupOnNic" xml:space="preserve">
259+
<value>The effective network security group list is empty because the specified network interface is not associated with a network security group or the subnet that is referenced by the network interface is also not associated with a network security group.</value>
260+
</data>
258261
</root>

0 commit comments

Comments
 (0)