Skip to content

Commit a5016d6

Browse files
author
maddieclayton
committed
merge
2 parents f294b85 + ae274af commit a5016d6

File tree

90 files changed

+22028
-64
lines changed

Some content is hidden

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

90 files changed

+22028
-64
lines changed

src/ResourceManager/Compute/Commands.Compute/help/Set-AzureRmVMADDomainExtension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Accept wildcard characters: False
108108
```
109109
110110
### -JoinOption
111-
Specifies the join option.
111+
Specifies the join option. For join options see [fJoinOptions](https://docs.microsoft.com/en-us/windows/desktop/api/lmjoin/nf-lmjoin-netjoindomain)
112112
113113
```yaml
114114
Type: System.Nullable`1[System.UInt32]

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.Netcore.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.5.0-preview" />
3333
<PackageReference Include="Microsoft.Azure.Insights" Version="0.15.0-preview" />
3434
<PackageReference Include="Microsoft.Azure.Management.Compute" Version="22.0.0" />
35+
<PackageReference Include="Microsoft.Azure.Management.ContainerInstance" Version="1.1.0" />
3536
<PackageReference Include="Microsoft.Azure.Management.Redis" Version="3.1.1-preview" />
3637
<PackageReference Include="Microsoft.Azure.Management.OperationalInsights" Version="0.18.0-preview" />
3738
</ItemGroup>

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.3.1.1-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
6363
<Private>True</Private>
6464
</Reference>
65+
<Reference Include="Microsoft.Azure.Management.ContainerInstance">
66+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ContainerInstance.1.1.0\lib\net452\Microsoft.Azure.Management.ContainerInstance.dll</HintPath>
67+
</Reference>
68+
<Reference Include="System.Runtime" />
6569
</ItemGroup>
6670
<ItemGroup>
6771
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -83,12 +87,14 @@
8387
<Compile Include="ScenarioTests\NetworkInterfaceTests.cs" />
8488
<Compile Include="ScenarioTests\LoadBalancerTests.cs" />
8589
<Compile Include="ScenarioTests\ExpressRouteCircuitTests.cs" />
90+
<Compile Include="ScenarioTests\NetworkProfileTests.cs" />
8691
<Compile Include="ScenarioTests\PublicIpPrefixTests.cs" />
8792
<Compile Include="ScenarioTests\RouteTableTests.cs" />
8893
<Compile Include="ScenarioTests\NetworkSecurityGroupTests.cs" />
8994
<Compile Include="ScenarioTests\Generated\RouteTableTestsGenerated.cs" />
9095
<Compile Include="ScenarioTests\TestDnsAvailabilityTest.cs" />
9196
<Compile Include="ScenarioTests\UsageTests.cs" />
97+
<Compile Include="ScenarioTests\VirtualNetworkTapTests.cs" />
9298
<Compile Include="ScenarioTests\VirtualNetworkTests.cs" />
9399
<Compile Include="ScenarioTests\PublicIpAddressTests.cs" />
94100
<Compile Include="ScenarioTests\VirtualNetworkGatewayTests.cs" />
@@ -168,6 +174,9 @@
168174
<None Include="ScenarioTests\ExpressRouteCircuitTests.ps1">
169175
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
170176
</None>
177+
<None Include="ScenarioTests\NetworkProfileTests.ps1">
178+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
179+
</None>
171180
<None Include="ScenarioTests\PublicIpPrefixTests.ps1">
172181
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
173182
</None>
@@ -186,6 +195,9 @@
186195
<None Include="ScenarioTests\UsageTests.ps1">
187196
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
188197
</None>
198+
<None Include="ScenarioTests\VirtualNetworkTapTests.ps1">
199+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
200+
</None>
189201
<None Include="ScenarioTests\VirtualNetworkTests.ps1">
190202
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
191203
</None>
@@ -352,6 +364,21 @@
352364
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkCloudExceptionTests\TestNotFound.json">
353365
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
354366
</None>
367+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkProfileTests\TestContainerNetworkInterfaceConfigCRUD.json">
368+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
369+
</None>
370+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkProfileTests\TestContainerNetworkInterfaceConfigCRUDMinimalParameters.json">
371+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
372+
</None>
373+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkProfileTests\TestNetworkProfileCRUDAllParameters.json">
374+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
375+
</None>
376+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkProfileTests\TestNetworkProfileCRUDMinimalParameters.json">
377+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
378+
</None>
379+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkInterfaceTests\TestNetworkInterfaceTapConfigurationCRUD.json">
380+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
381+
</None>
355382
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.NetworkSecurityGroupTests\TestNetworkSecurityGroupMultiValuedRules.json">
356383
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
357384
</None>
@@ -646,6 +673,9 @@
646673
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests\VirtualNetworkGatewayVpnCustomIpsecPolicySetTest.json">
647674
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
648675
</None>
676+
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTapTests\TestVirtualNetworkTapCRUDUsingIpConfig.json">
677+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
678+
</None>
649679
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestResourceNavigationLinksOnSubnetCRUD.json">
650680
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
651681
</None>
@@ -711,9 +741,13 @@
711741
<Project>{98cfd96b-a6bc-4f15-ae2c-603fc2b58981}</Project>
712742
<Name>Commands.Network</Name>
713743
</ProjectReference>
744+
<ProjectReference Include="..\..\ContainerInstance\Commands.ContainerInstance\Commands.ContainerInstance.csproj">
745+
<Project>{0E11B67A-1257-40D0-BD33-8315759FDB01}</Project>
746+
<Name>Commands.ContainerInstance</Name>
747+
</ProjectReference>
714748
</ItemGroup>
715749
<ItemGroup>
716750
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
717751
</ItemGroup>
718752
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
719-
</Project>
753+
</Project>

src/ResourceManager/Network/Commands.Network.Test/NetworkResourcesController.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
1616
using Microsoft.Azure.Management.Compute;
17+
using Microsoft.Azure.Management.ContainerInstance;
1718
using Microsoft.Azure.Management.Network;
1819
using Microsoft.Azure.Management.Redis;
1920
using Microsoft.Azure.Management.Storage;
@@ -43,6 +44,8 @@ public sealed class NetworkResourcesController
4344

4445
public ComputeManagementClient ComputeManagementClient { get; private set; }
4546

47+
public ContainerInstanceManagementClient ContainerInstanceManagementClient { get; set; }
48+
4649
public StorageManagementClient StorageManagementClient { get; private set; }
4750

4851
public RedisManagementClient RedisManagementClient { get; private set; }
@@ -126,6 +129,7 @@ public void RunPsTestWorkflow(
126129
_helper.GetRMModulePath("AzureRM.Insights.psd1"),
127130
_helper.GetRMModulePath("AzureRM.Network.psd1"),
128131
_helper.GetRMModulePath("AzureRM.Compute.psd1"),
132+
_helper.GetRMModulePath("AzureRM.ContainerInstance.psd1"),
129133
_helper.GetRMModulePath("AzureRM.OperationalInsights.psd1"),
130134
#if !NETSTANDARD
131135
_helper.RMStorageDataPlaneModule,
@@ -164,6 +168,7 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
164168
var resourceManagerResourceManagementClient = GetResourceManagerResourceManagementClient(context);
165169
NetworkManagementClient = GetNetworkManagementClient(context);
166170
ComputeManagementClient = GetComputeManagementClient(context);
171+
ContainerInstanceManagementClient = GetContainerInstanceManagementClient(context);
167172
StorageManagementClient = GetStorageManagementClient(context);
168173
RedisManagementClient = GetRedisManagementClient(context);
169174
SubscriptionClient = GetSubscriptionClient(context);
@@ -173,6 +178,7 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
173178
resourceManagerResourceManagementClient,
174179
NetworkManagementClient,
175180
ComputeManagementClient,
181+
ContainerInstanceManagementClient,
176182
StorageManagementClient,
177183
RedisManagementClient,
178184
SubscriptionClient,
@@ -208,5 +214,10 @@ private static OperationalInsightsManagementClient GetOperationalInsightsManagem
208214
{
209215
return context.GetServiceClient<OperationalInsightsManagementClient>(RestTestFramework.TestEnvironmentFactory.GetTestEnvironment());
210216
}
217+
218+
private static ContainerInstanceManagementClient GetContainerInstanceManagementClient(RestTestFramework.MockContext context)
219+
{
220+
return context.GetServiceClient<ContainerInstanceManagementClient>(RestTestFramework.TestEnvironmentFactory.GetTestEnvironment());
221+
}
211222
}
212223
}

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/NetworkInterfaceTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,13 @@ public void TestNetworkInterfaceWithAcceleratedNetworking()
116116
{
117117
NetworkResourcesController.NewInstance.RunPsTest(_logger, "Test-NetworkInterfaceWithAcceleratedNetworking");
118118
}
119+
120+
[Fact]
121+
[Trait(Category.AcceptanceType, Category.CheckIn)]
122+
[Trait(Category.Owner, Category.sdnnrp)]
123+
public void TestNetworkInterfaceTapConfigurationCRUD()
124+
{
125+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-NetworkInterfaceTapConfigurationCRUD"));
126+
}
119127
}
120128
}

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/NetworkInterfaceTests.ps1

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,3 +887,98 @@ function Test-NetworkInterfaceWithAcceleratedNetworking
887887
Clean-ResourceGroup $rgname
888888
}
889889
}
890+
891+
<#
892+
.SYNOPSIS
893+
Test creating new NetworkInterfaceTapConfiguration using minimal set of parameters
894+
#>
895+
function Test-NetworkInterfaceTapConfigurationCRUD
896+
{
897+
# Setup
898+
# Setup
899+
$rgname = Get-ResourceGroupName
900+
$vnetName = Get-ResourceName
901+
$subnetName = Get-ResourceName
902+
$publicIpName = Get-ResourceName
903+
$nicName = Get-ResourceName
904+
$domainNameLabel = Get-ResourceName
905+
$rglocation = Get-ProviderLocation ResourceManagement
906+
$resourceTypeParent = "Microsoft.Network/networkInterfaces"
907+
$location = Get-ProviderLocation $resourceTypeParent
908+
$rname = Get-ResourceName
909+
$vtapName = Get-ResourceName
910+
$vtapName2 = Get-ResourceName
911+
$sourceIpConfigName = Get-ResourceName
912+
$sourceNicName = Get-ResourceName
913+
914+
try
915+
{
916+
# Create the resource group
917+
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
918+
919+
# Create the Virtual Network
920+
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24
921+
$vnet = New-AzureRmvirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet
922+
923+
# Create the publicip
924+
$publicip = New-AzureRmPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel
925+
926+
# Create NetworkInterface
927+
$job = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip -AsJob
928+
$job | Wait-Job
929+
$expectedNic = Get-AzureRmNetworkInterface -Name $nicName -ResourceGroupName $rgname
930+
931+
# Create required dependencies (Vtap)
932+
$DestinationEndpoint = $expectedNic.IpConfigurations[0]
933+
$actualVtap = New-AzureRmVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName -Location $location -DestinationNetworkInterfaceIPConfiguration $DestinationEndpoint -Force
934+
$vVirtualNetworkTap = Get-AzureRmVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName;
935+
936+
# Create source Nic which is getting tapped
937+
$sourceIpConfig = New-AzureRmNetworkInterfaceIpConfig -Name $sourceIpConfigName -Subnet $vnet.Subnets[0]
938+
$sourceNic = New-AzureRmNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname -Location $location -IpConfiguration $sourceIpConfig -Tag @{ testtag = "testval" }
939+
940+
# Add tap configuration
941+
Add-AzureRmNetworkInterfaceTapConfig -NetworkInterface $sourceNic -VirtualNetworkTap $vVirtualNetworkTap -Name $rname
942+
943+
#get tap configuration
944+
$tapConfig = Get-AzureRmNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname
945+
Assert-NotNull $tapConfig
946+
Assert-AreEqual $tapConfig.ResourceGroupName $rgname
947+
Assert-AreEqual $tapConfig.NetworkInterfaceName $sourceNicName
948+
Assert-AreEqual $tapConfig.Name $rname
949+
950+
# get nic and check back reference
951+
$sourceNic = Get-AzureRmNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname
952+
Assert-NotNull $sourceNic.TapConfigurations
953+
Assert-NotNull $sourceNic.TapConfigurations[0]
954+
Assert-AreEqual $sourceNic.TapConfigurations[0].Id $tapConfig.Id
955+
956+
# get vtap and check back reference
957+
$vVirtualNetworkTap = Get-AzureRmVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName;
958+
Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations
959+
Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0]
960+
Assert-AreEqual $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0].Id $tapConfig.Id
961+
962+
963+
# Remove NetworkInterfaceTapConfiguration
964+
$removeNetworkInterfaceTapConfiguration = Remove-AzureRmNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname -PassThru -Force;
965+
Assert-AreEqual $true $removeNetworkInterfaceTapConfiguration;
966+
967+
$sourceNic = Get-AzureRmNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname
968+
Assert-NotNull $sourceNic.TapConfigurations
969+
Assert-Null $sourceNic.TapConfigurations[0]
970+
971+
# get vtap and check back reference
972+
$vVirtualNetworkTap = Get-AzureRmVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName;
973+
Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations
974+
Assert-Null $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0]
975+
976+
# Get NetworkInterfaceTapConfiguration should fail
977+
Assert-ThrowsContains { Get-AzureRmNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname } "not found";
978+
}
979+
finally
980+
{
981+
# Cleanup
982+
Clean-ResourceGroup $rgname;
983+
}
984+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// <auto-generated>
2+
// Copyright (c) Microsoft and contributors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
//
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
//
17+
// Warning: This code was generated by a tool.
18+
//
19+
// Changes to this file may cause incorrect behavior and will be lost if the
20+
// code is regenerated.
21+
//
22+
// For documentation on code generator please visit
23+
// https://aka.ms/nrp-code-generation
24+
// Please contact [email protected] if you need to make changes to this file.
25+
// </auto-generated>
26+
27+
using System;
28+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
29+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
30+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
31+
using Xunit;
32+
using Xunit.Abstractions;
33+
34+
namespace Commands.Network.Test.ScenarioTests
35+
{
36+
public class NetworkProfileTests : RMTestBase
37+
{
38+
public XunitTracingInterceptor _logger;
39+
40+
public NetworkProfileTests(Xunit.Abstractions.ITestOutputHelper output)
41+
{
42+
_logger = new XunitTracingInterceptor(output);
43+
XunitTracingInterceptor.AddToContext(_logger);
44+
}
45+
46+
[Fact]
47+
[Trait(Category.AcceptanceType, Category.CheckIn)]
48+
[Trait(Category.Owner, Category.sdnnrp)]
49+
public void TestNetworkProfileCRUDMinimalParameters()
50+
{
51+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-NetworkProfileCRUDMinimalParameters"));
52+
}
53+
54+
[Fact]
55+
[Trait(Category.AcceptanceType, Category.CheckIn)]
56+
[Trait(Category.Owner, Category.sdnnrp)]
57+
public void TestNetworkProfileCRUDAllParameters()
58+
{
59+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-NetworkProfileCRUDAllParameters"));
60+
}
61+
62+
[Fact]
63+
[Trait(Category.AcceptanceType, Category.CheckIn)]
64+
[Trait(Category.Owner, Category.sdnnrp)]
65+
public void TestContainerNetworkInterfaceConfigCRUDMinimalParameters()
66+
{
67+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-ContainerNetworkInterfaceConfigCRUDMinimalParameters"));
68+
}
69+
70+
[Fact]
71+
[Trait(Category.AcceptanceType, Category.CheckIn)]
72+
[Trait(Category.Owner, Category.sdnnrp)]
73+
public void TestContainerNetworkInterfaceConfigCRUD()
74+
{
75+
NetworkResourcesController.NewInstance.RunPsTest(_logger, string.Format("Test-ContainerNetworkInterfaceConfigCRUD"));
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)