Skip to content

Commit 83c6aa0

Browse files
committed
Merge pull request #22 from Azure/ignite
Ignite
2 parents c4133e2 + 5a24c6a commit 83c6aa0

File tree

67 files changed

+7342
-11208
lines changed

Some content is hidden

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

67 files changed

+7342
-11208
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
5757
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
5858
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
59+
<XUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
5960
</ItemGroup>
6061

6162
<Target Name="InvokeMSTest">

src/ServiceManagement.Network.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
33
VisualStudioVersion = 12.0.30723.0
44
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "ServiceManagement\Network\Commands.Network\Commands.Network.csproj", "{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Network", "ServiceManagement\Network\Commands.Network\Commands.ServiceManagement.Network.csproj", "{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.ServiceManagement.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
88
EndProject
99
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands", "ServiceManagement\Services\Commands\Commands.csproj", "{CD5AA507-F5EF-473D-855B-84B91A1ABE54}"
1010
EndProject

src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -151,6 +151,14 @@
151151
<Compile Include="NetworkSecurityGroups\SetNetworkSecurityGroupAssociationTests.cs" />
152152
<Compile Include="Properties\AssemblyInfo.cs" />
153153
<Compile Include="Routes\GetEffectiveRouteTests.cs" />
154+
<Compile Include="Routes\GetRouteTableTests.cs" />
155+
<Compile Include="Routes\GetSubnetRouteTableTests.cs" />
156+
<Compile Include="Routes\NewRouteTableTests.cs" />
157+
<Compile Include="Routes\RemoveRouteTableTests.cs" />
158+
<Compile Include="Routes\RemoveRouteTests.cs" />
159+
<Compile Include="Routes\RemoveSubnetRouteTableTests.cs" />
160+
<Compile Include="Routes\SetRouteTests.cs" />
161+
<Compile Include="Routes\SetSubnetRouteTableTests.cs" />
154162
<Compile Include="ScenarioTests\IPForwarding\IPForwardingScenarioTests.cs" />
155163
<Compile Include="ScenarioTests\NetworkSecurityGroup\NSGScenarioTests.cs" />
156164
<Compile Include="ScenarioTests\NetworkTests.cs" />
@@ -202,40 +210,31 @@
202210
</ProjectReference>
203211
</ItemGroup>
204212
<ItemGroup>
205-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.IPForwardingScenarioTests\SetIPForwardingOnNICAndUpdateVM.json">
213+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\CreateAndRemoveNSG.json">
206214
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
207215
</None>
208-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.IPForwardingScenarioTests\SetIPForwardingOnVMAndUpdateVM.json">
216+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\GetMultipleNSGs.json">
209217
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
210218
</None>
211-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\SetNSGOnNICAndUpdateVM.json">
219+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\RemoveNSGFromSubnet.json">
212220
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
213221
</None>
214-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\SetNSGOnRoleAndUpdateVM.json">
222+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\RemoveNSGWithNonExistingName.json">
215223
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
216224
</None>
217-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestCreateAndRemoveNSG.json">
225+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\RemoveNSR.json">
218226
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
219227
</None>
220-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestGetMultipleNSGs.json">
228+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\SetAndGetNSGForSubnet.json">
221229
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
222230
</None>
223-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestRemoveNSGFromSubnet.json">
231+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\SetNSGToSubnetInDiffRegion.json">
224232
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
225233
</None>
226-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestRemoveNSGWithNonExistingName.json">
234+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\SetNSR.json">
227235
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
228236
</None>
229-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestRemoveNSR.json">
230-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
231-
</None>
232-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestSetAndGetNSGForSubnet.json">
233-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
234-
</None>
235-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestSetNSR.json">
236-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
237-
</None>
238-
<None Include="SessionRecords\Microsoft.Azure.Commands.Network.Test.ScenarioTests.NSGScenarioTests\TestSetNSRWithInvalidParameter.json">
237+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.ScenarioTests.NSGScenarioTests\SetNSRWithInvalidParameter.json">
239238
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
240239
</None>
241240
<None Include="TestData\EmptyNetworkConfiguration.xml">

src/ServiceManagement/Network/Commands.Network.Test/IPForwarding/GetIPForwardingTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Moq;
2525
using System.Threading;
2626
using System.Threading.Tasks;
27+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2728
using Xunit;
2829

2930
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.IPForwarding
@@ -88,6 +89,8 @@ public GetIPForwardingTests()
8889
}
8990

9091
[Fact]
92+
[Trait(Category.Service, Category.Network)]
93+
[Trait(Category.AcceptanceType, Category.CheckIn)]
9194
public void GetIPForwardingOnRoleSucceeds()
9295
{
9396
// Setup
@@ -124,6 +127,8 @@ public void GetIPForwardingOnRoleSucceeds()
124127
}
125128

126129
[Fact]
130+
[Trait(Category.Service, Category.Network)]
131+
[Trait(Category.AcceptanceType, Category.CheckIn)]
127132
public void GetIPForwardingOnVMSucceeds()
128133
{
129134
// Setup
@@ -167,6 +172,8 @@ public void GetIPForwardingOnVMSucceeds()
167172
}
168173

169174
[Fact]
175+
[Trait(Category.Service, Category.Network)]
176+
[Trait(Category.AcceptanceType, Category.CheckIn)]
170177
public void GetIPForwardingOnVMNicSucceeds()
171178
{
172179
// Setup

src/ServiceManagement/Network/Commands.Network.Test/IPForwarding/SetIPForwardingTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using System.Management.Automation;
2626
using System.Threading;
2727
using System.Threading.Tasks;
28+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2829
using Xunit;
2930

3031
namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.IPForwarding
@@ -84,18 +85,24 @@ public SetIPForwardingTests()
8485
#region Enable
8586

8687
[Fact]
88+
[Trait(Category.Service, Category.Network)]
89+
[Trait(Category.AcceptanceType, Category.CheckIn)]
8790
public void EnableIPForwardingOnRoleSucceeds()
8891
{
8992
SetIPForwardingOnRole(enable: true, disable: false);
9093
}
9194

9295
[Fact]
96+
[Trait(Category.Service, Category.Network)]
97+
[Trait(Category.AcceptanceType, Category.CheckIn)]
9398
public void EnableIPForwardingOnVMSucceeds()
9499
{
95100
SetIPForwardingOnVM(enable: true, disable: false);
96101
}
97102

98103
[Fact]
104+
[Trait(Category.Service, Category.Network)]
105+
[Trait(Category.AcceptanceType, Category.CheckIn)]
99106
public void EnableIPForwardingOnVMNicSucceeds()
100107
{
101108
SetIPForwardingOnVMNic(enable: true, disable: false);
@@ -106,18 +113,24 @@ public void EnableIPForwardingOnVMNicSucceeds()
106113
#region Disable
107114

108115
[Fact]
116+
[Trait(Category.Service, Category.Network)]
117+
[Trait(Category.AcceptanceType, Category.CheckIn)]
109118
public void DisableIPForwardingOnRoleSucceeds()
110119
{
111120
SetIPForwardingOnRole(enable: false, disable: true);
112121
}
113122

114123
[Fact]
124+
[Trait(Category.Service, Category.Network)]
125+
[Trait(Category.AcceptanceType, Category.CheckIn)]
115126
public void DisableIPForwardingOnVMSucceeds()
116127
{
117128
SetIPForwardingOnVM(enable: false, disable: true);
118129
}
119130

120131
[Fact]
132+
[Trait(Category.Service, Category.Network)]
133+
[Trait(Category.AcceptanceType, Category.CheckIn)]
121134
public void DisbableIPForwardingOnVMNicSucceeds()
122135
{
123136
SetIPForwardingOnVMNic(enable: false, disable: true);

src/ServiceManagement/Network/Commands.Network.Test/NetworkSecurityGroups/GetNetworkSecurityGroupAssociationTests.cs

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.NetworkSecurityGroup.Association;
2222
using Microsoft.WindowsAzure.Commands.ServiceManagement.Network.NetworkSecurityGroup.Model;
2323
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
24+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2425
using Microsoft.WindowsAzure.Commands.ServiceManagement.Model;
2526
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2627
using Microsoft.WindowsAzure.Management.Compute;
@@ -161,6 +162,8 @@ public GetNetworkSecurityGroupAssociationTests()
161162
#region No Details
162163

163164
[Fact]
165+
[Trait(Category.Service, Category.Network)]
166+
[Trait(Category.AcceptanceType, Category.CheckIn)]
164167
public void GetNSGForSubnetNoDetails()
165168
{
166169
// Setup
@@ -183,13 +186,24 @@ public void GetNSGForSubnetNoDetails()
183186
It.IsAny<CancellationToken>()),
184187
Times.Once);
185188

189+
networkingClientMock.Verify(
190+
c => c.NetworkSecurityGroups.GetAsync(
191+
NetworkSecurityGroupName,
192+
null,
193+
It.IsAny<CancellationToken>()),
194+
Times.Once);
195+
186196
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
187197
Assert.IsType<SimpleNetworkSecurityGroup>(mockCommandRuntime.OutputPipeline.Single());
188198
var nsg = (SimpleNetworkSecurityGroup)(mockCommandRuntime.OutputPipeline.Single());
189199
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
200+
Assert.Equal(NSGLocation, nsg.Location);
201+
Assert.Equal(NSGLabel, nsg.Label);
190202
}
191203

192204
[Fact]
205+
[Trait(Category.Service, Category.Network)]
206+
[Trait(Category.AcceptanceType, Category.CheckIn)]
193207
public void GetNSGForVMRoleNoDetails()
194208
{
195209
// Setup
@@ -213,13 +227,24 @@ public void GetNSGForVMRoleNoDetails()
213227
It.IsAny<CancellationToken>()),
214228
Times.Once);
215229

230+
networkingClientMock.Verify(
231+
c => c.NetworkSecurityGroups.GetAsync(
232+
NetworkSecurityGroupName,
233+
null,
234+
It.IsAny<CancellationToken>()),
235+
Times.Once);
236+
216237
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
217238
Assert.IsType<SimpleNetworkSecurityGroup>(mockCommandRuntime.OutputPipeline.Single());
218239
var nsg = (SimpleNetworkSecurityGroup)(mockCommandRuntime.OutputPipeline.Single());
219240
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
241+
Assert.Equal(NSGLocation, nsg.Location);
242+
Assert.Equal(NSGLabel, nsg.Label);
220243
}
221244

222245
[Fact]
246+
[Trait(Category.Service, Category.Network)]
247+
[Trait(Category.AcceptanceType, Category.CheckIn)]
223248
public void GetNSGForVMNicNoDetails()
224249
{
225250
// Setup
@@ -245,17 +270,28 @@ public void GetNSGForVMNicNoDetails()
245270
It.IsAny<CancellationToken>()),
246271
Times.Once);
247272

273+
networkingClientMock.Verify(
274+
c => c.NetworkSecurityGroups.GetAsync(
275+
NetworkSecurityGroupName,
276+
null,
277+
It.IsAny<CancellationToken>()),
278+
Times.Once);
279+
248280
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
249281
Assert.IsType<SimpleNetworkSecurityGroup>(mockCommandRuntime.OutputPipeline.Single());
250282
var nsg = (SimpleNetworkSecurityGroup)(mockCommandRuntime.OutputPipeline.Single());
251283
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
284+
Assert.Equal(NSGLocation, nsg.Location);
285+
Assert.Equal(NSGLabel, nsg.Label);
252286
}
253287

254288
#endregion
255289

256290
#region With Details
257291

258292
[Fact]
293+
[Trait(Category.Service, Category.Network)]
294+
[Trait(Category.AcceptanceType, Category.CheckIn)]
259295
public void GetNSGForSubnetWithDetails()
260296
{
261297
// Setup
@@ -279,20 +315,28 @@ public void GetNSGForSubnetWithDetails()
279315
It.IsAny<CancellationToken>()),
280316
Times.Once);
281317

318+
networkingClientMock.Verify(
319+
c => c.NetworkSecurityGroups.GetAsync(
320+
NetworkSecurityGroupName,
321+
"Full",
322+
It.IsAny<CancellationToken>()),
323+
Times.Once);
324+
282325
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
283326
Assert.IsType<NetworkSecurityGroupWithRules>(mockCommandRuntime.OutputPipeline.Single());
284327
var nsg = (NetworkSecurityGroupWithRules)(mockCommandRuntime.OutputPipeline.Single());
285328
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
286329
Assert.Equal(NSGLabel, nsg.Label);
287330
Assert.Equal(NSGLocation, nsg.Location);
288331
Assert.NotEmpty(nsg.Rules);
289-
Assert.Equal<string>("", "");
290332
Assert.Equal(Rules.First().Name, nsg.Rules.First().Name);
291333
Assert.Equal(Rules.First().Action, nsg.Rules.First().Action);
292334
Assert.Equal(Rules.First().Protocol, nsg.Rules.First().Protocol);
293335
}
294336

295337
[Fact]
338+
[Trait(Category.Service, Category.Network)]
339+
[Trait(Category.AcceptanceType, Category.CheckIn)]
296340
public void GetNSGForVMRoleDetails()
297341
{
298342
// Setup
@@ -317,20 +361,28 @@ public void GetNSGForVMRoleDetails()
317361
It.IsAny<CancellationToken>()),
318362
Times.Once);
319363

364+
networkingClientMock.Verify(
365+
c => c.NetworkSecurityGroups.GetAsync(
366+
NetworkSecurityGroupName,
367+
"Full",
368+
It.IsAny<CancellationToken>()),
369+
Times.Once);
370+
320371
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
321372
Assert.IsType<NetworkSecurityGroupWithRules>(mockCommandRuntime.OutputPipeline.Single());
322373
var nsg = (NetworkSecurityGroupWithRules)(mockCommandRuntime.OutputPipeline.Single());
323374
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
324375
Assert.Equal(NSGLabel, nsg.Label);
325376
Assert.Equal(NSGLocation, nsg.Location);
326377
Assert.NotEmpty(nsg.Rules);
327-
Assert.Equal<string>("", "");
328378
Assert.Equal(Rules.First().Name, nsg.Rules.First().Name);
329379
Assert.Equal(Rules.First().Action, nsg.Rules.First().Action);
330380
Assert.Equal(Rules.First().Protocol, nsg.Rules.First().Protocol);
331381
}
332382

333383
[Fact]
384+
[Trait(Category.Service, Category.Network)]
385+
[Trait(Category.AcceptanceType, Category.CheckIn)]
334386
public void GetNSGForVMNicDetails()
335387
{
336388
// Setup
@@ -357,14 +409,20 @@ public void GetNSGForVMNicDetails()
357409
It.IsAny<CancellationToken>()),
358410
Times.Once);
359411

412+
networkingClientMock.Verify(
413+
c => c.NetworkSecurityGroups.GetAsync(
414+
NetworkSecurityGroupName,
415+
"Full",
416+
It.IsAny<CancellationToken>()),
417+
Times.Once);
418+
360419
Assert.Equal(1, mockCommandRuntime.OutputPipeline.Count);
361420
Assert.IsType<NetworkSecurityGroupWithRules>(mockCommandRuntime.OutputPipeline.Single());
362421
var nsg = (NetworkSecurityGroupWithRules)(mockCommandRuntime.OutputPipeline.Single());
363422
Assert.Equal(NetworkSecurityGroupName, nsg.Name);
364423
Assert.Equal(NSGLabel, nsg.Label);
365424
Assert.Equal(NSGLocation, nsg.Location);
366425
Assert.NotEmpty(nsg.Rules);
367-
Assert.Equal<string>("", "");
368426
Assert.Equal(Rules.First().Name, nsg.Rules.First().Name);
369427
Assert.Equal(Rules.First().Action, nsg.Rules.First().Action);
370428
Assert.Equal(Rules.First().Protocol, nsg.Rules.First().Protocol);

0 commit comments

Comments
 (0)