Skip to content

Commit 13df1d4

Browse files
author
Samuel Anudeep
committed
test changes
1 parent 5e7b211 commit 13df1d4

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/Commands.RecoveryServices.Backup.Test.csproj

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,18 @@
124124
<None Include="packages.config">
125125
<SubType>Designer</SubType>
126126
</None>
127-
<None Include="ScenarioTests\AzureSql\ContainerTests.ps1" />
128-
<None Include="ScenarioTests\AzureSql\ItemTests.ps1" />
129-
<None Include="ScenarioTests\AzureSql\PolicyTests.ps1" />
130-
<None Include="ScenarioTests\Dpm\ContainerTests.ps1" />
127+
<None Include="ScenarioTests\AzureSql\ContainerTests.ps1">
128+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
129+
</None>
130+
<None Include="ScenarioTests\AzureSql\ItemTests.ps1">
131+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
132+
</None>
133+
<None Include="ScenarioTests\AzureSql\PolicyTests.ps1">
134+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
135+
</None>
136+
<None Include="ScenarioTests\Dpm\ContainerTests.ps1">
137+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
138+
</None>
131139
<None Include="ScenarioTests\IaasVm\Common.ps1">
132140
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
133141
</None>
@@ -144,10 +152,18 @@
144152
<Compile Include="ScenarioTests\IaasVm\PolicyTests.cs" />
145153
<Compile Include="ScenarioTests\Mab\ContainerTests.cs" />
146154
<Compile Include="ScenarioTests\TestsBase.cs" />
147-
<None Include="ScenarioTests\IaasVm\ItemTests.ps1" />
148-
<None Include="ScenarioTests\IaasVm\JobTests.ps1" />
149-
<None Include="ScenarioTests\IaasVm\PolicyTests.ps1" />
150-
<None Include="ScenarioTests\Mab\ContainerTests.ps1" />
155+
<None Include="ScenarioTests\IaasVm\ItemTests.ps1">
156+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
157+
</None>
158+
<None Include="ScenarioTests\IaasVm\JobTests.ps1">
159+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
160+
</None>
161+
<None Include="ScenarioTests\IaasVm\PolicyTests.ps1">
162+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
163+
</None>
164+
<None Include="ScenarioTests\Mab\ContainerTests.ps1">
165+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
166+
</None>
151167
<None Include="SessionRecords\Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests.ContainerTests\TestGetAzureSqlContainer.json">
152168
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
153169
</None>
@@ -236,6 +252,10 @@
236252
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>
237253
<Name>Commands.Common.Authentication</Name>
238254
</ProjectReference>
255+
<ProjectReference Include="..\..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj">
256+
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
257+
<Name>Commands.ResourceManager.Common</Name>
258+
</ProjectReference>
239259
<ProjectReference Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj">
240260
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
241261
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ $vmUniqueName = "iaasvmcontainerv2;" + $vmResourceGroupName + ";" + $vmName;
2525
function Test-GetItemScenario
2626
{
2727
# 1. Create / update and get vault
28-
$vaultLocation = get_available_location;
28+
#$vaultLocation = get_available_location;
2929
$vault = New-AzureRmRecoveryServicesVault `
30-
-Name $resourceName -ResourceGroupName $resourceGroupName -Location $vaultLocation;
30+
-Name $resourceName -ResourceGroupName $resourceGroupName -Location "westus";
3131

3232
# 2. Set vault context
3333
Set-AzureRmRecoveryServicesVaultContext -Vault $vault;

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Test/ScenarioTests/TestsBase.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
using RecoveryServicesNS = Microsoft.Azure.Management.RecoveryServices;
3434
using ResourceManagementNS = Microsoft.Azure.Management.Resources;
3535
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
36+
using HyakRmNS = Microsoft.Azure.Management.Internal.Resources;
3637

3738
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests
3839
{
@@ -47,6 +48,8 @@ public class TestController
4748

4849
public ResourceManagementNS.ResourceManagementClient RmClient { get; private set; }
4950

51+
public HyakRmNS.ResourceManagementClient HyakRmClient { get; private set; }
52+
5053
protected string ResourceNamespace { get; private set; }
5154

5255
public static TestController NewInstance
@@ -73,6 +76,7 @@ protected void SetupManagementClients(RestTestFramework.MockContext context)
7376
RsBackupClient = GetRsBackupClient(context);
7477
RsClient = GetRsClient();
7578
RmClient = GetResourceManagementClient();
79+
HyakRmClient = GetHyakRmClient();
7680
//SubscriptionClient = GetSubscriptionClient();
7781
//CognitiveServicesClient = GetCognitiveServicesManagementClient(context);
7882
//GalleryClient = GetGalleryClient();
@@ -81,14 +85,20 @@ protected void SetupManagementClients(RestTestFramework.MockContext context)
8185
helper.SetupManagementClients(
8286
RsBackupClient,
8387
RsClient,
84-
RmClient);
88+
RmClient,
89+
HyakRmClient);
8590
}
8691

8792
private ResourceManagementNS.ResourceManagementClient GetResourceManagementClient()
8893
{
8994
return TestBase.GetServiceClient<ResourceManagementNS.ResourceManagementClient>(this.csmTestFactory);
9095
}
9196

97+
private HyakRmNS.ResourceManagementClient GetHyakRmClient()
98+
{
99+
return TestBase.GetServiceClient<HyakRmNS.ResourceManagementClient>(this.csmTestFactory);
100+
}
101+
92102
public void RunPsTest(PsBackupProviderTypes providerType, params string[] scripts)
93103
{
94104
var callingClassType = TestUtilities.GetCallingClass(2);

0 commit comments

Comments
 (0)