Skip to content

ResourceNavigationLinks + Test-AzureRmPrivateIPAddress cmdlet #2893

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

Merged
merged 6 commits into from
Sep 7, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@
<Reference Include="Microsoft.Azure.Management.Authorization">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Reference Include="Microsoft.Azure.Management.Network">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.6.1.1-preview\lib\net45\Microsoft.Azure.Management.Network.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Insights">
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.13.1-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Redis">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.3.1.1-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -361,6 +368,9 @@
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests\TestVirtualNetworkExpressRouteGatewayCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestResourceNavigationLinksOnSubnetCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Commands.Network.Test.ScenarioTests.VirtualNetworkTests\TestVirtualNetworkCRUD.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Insights;
using Microsoft.Azure.Management.Network;
using Microsoft.Azure.Management.Redis;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Subscriptions;
using Microsoft.Azure.Test;
Expand Down Expand Up @@ -44,6 +46,10 @@ public sealed class NetworkResourcesController

public NetworkManagementClient NetworkManagementClient { get; private set; }

public InsightsManagementClient InsightsManagementClient { get; private set; }

public RedisManagementClient RedisManagementClient { get; private set; }

public static NetworkResourcesController NewInstance
{
get
Expand Down Expand Up @@ -109,6 +115,8 @@ public void RunPsTestWorkflow(
"ScenarioTests\\" + callingClassName + ".ps1",
helper.RMProfileModule,
helper.RMResourceModule,
helper.GetRMModulePath("AzureRM.Insights.psd1"),
helper.GetRMModulePath("AzureRM.RedisCache.psd1"),
helper.GetRMModulePath("AzureRM.Network.psd1"),
"AzureRM.Resources.ps1");

Expand Down Expand Up @@ -141,13 +149,17 @@ private void SetupManagementClients(RestTestFramework.MockContext context)
this.GalleryClient = this.GetGalleryClient();
this.NetworkManagementClient = this.GetNetworkManagementClient(context);
this.AuthorizationManagementClient = this.GetAuthorizationManagementClient();
this.InsightsManagementClient = this.GetInsightsManagementClient();
this.RedisManagementClient = this.GetRedisManagementClient(context);

helper.SetupManagementClients(
ResourceManagementClient,
SubscriptionClient,
GalleryClient,
AuthorizationManagementClient,
this.NetworkManagementClient);
this.NetworkManagementClient,
this.InsightsManagementClient,
this.RedisManagementClient);
}

private AuthorizationManagementClient GetAuthorizationManagementClient()
Expand All @@ -169,9 +181,20 @@ private NetworkManagementClient GetNetworkManagementClient(RestTestFramework.Moc
{
return context.GetServiceClient<NetworkManagementClient>(RestTestFramework.TestEnvironmentFactory.GetTestEnvironment());
}

private GalleryClient GetGalleryClient()
{
return TestBase.GetServiceClient<GalleryClient>(this.csmTestFactory);
}

private InsightsManagementClient GetInsightsManagementClient()
{
return TestBase.GetServiceClient<InsightsManagementClient>(this.csmTestFactory);
}

private RedisManagementClient GetRedisManagementClient(RestTestFramework.MockContext context)
{
return context.GetServiceClient<RedisManagementClient>(RestTestFramework.TestEnvironmentFactory.GetTestEnvironment());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,16 @@ function Clean-ResourceGroup($rgname)
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) {
Remove-AzureRmResourceGroup -Name $rgname -Force
}
}

<#
.SYNOPSIS
Sleeps but only during recording.
#>
function Start-TestSleep($milliseconds)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
Start-Sleep -Milliseconds $milliseconds
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,12 @@ public void TestVirtualNetworkPeeringCRUD()
{
NetworkResourcesController.NewInstance.RunPsTest("Test-VirtualNetworkPeeringCRUD");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestResourceNavigationLinksOnSubnetCRUD()
{
NetworkResourcesController.NewInstance.RunPsTest("Test-ResourceNavigationLinksCRUD");
}
}
}
Loading