Skip to content

Commit 1eac61d

Browse files
committed
Merge pull request #770 from AsrArmOneSdk/dev
Site Recovery (ARM) PS changes
2 parents 54a5daa + 1df940d commit 1eac61d

File tree

38 files changed

+1488
-1187
lines changed

38 files changed

+1488
-1187
lines changed

setup/azurecmdfiles.wxi

Lines changed: 76 additions & 4 deletions
Large diffs are not rendered by default.

src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Commands.SiteRecovery.Test.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.1.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
3838
</Reference>
3939
<Reference Include="Microsoft.Azure.Management.SiteRecovery, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
40-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.0-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll</HintPath>
40+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.1-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll</HintPath>
4141
<Private>True</Private>
4242
</Reference>
4343
<Reference Include="Hyak.Common">
@@ -87,6 +87,10 @@
8787
<Reference Include="Microsoft.WindowsAzure.Management">
8888
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
8989
</Reference>
90+
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
91+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.2.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
92+
<Private>True</Private>
93+
</Reference>
9094
<Reference Include="Microsoft.WindowsAzure.Testing, Version=1.0.5417.13285, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
9195
<SpecificVersion>False</SpecificVersion>
9296
<HintPath>..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll</HintPath>

src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/ScenarioTests/SiteRecoveryTestsBase.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using Microsoft.WindowsAzure;
2424
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2525
using Microsoft.WindowsAzure.Commands.Utilities.Common;
26+
using Microsoft.WindowsAzure.Management.Scheduler;
2627
using Microsoft.Azure.Management.RecoveryServices;
2728
using Microsoft.Azure.Management.SiteRecovery;
2829
using Microsoft.Azure.Test;
@@ -41,6 +42,7 @@ public abstract class SiteRecoveryTestsBase
4142

4243
public SiteRecoveryManagementClient SiteRecoveryMgmtClient { get; private set; }
4344
public RecoveryServicesManagementClient RecoveryServicesMgmtClient { get; private set; }
45+
public CloudServiceManagementClient CloudServiceManagementClient { get; private set; }
4446

4547
protected SiteRecoveryTestsBase()
4648
{
@@ -82,10 +84,11 @@ protected SiteRecoveryTestsBase()
8284

8385
protected void SetupManagementClients()
8486
{
87+
CloudServiceManagementClient = GetCloudServicesManagementClient();
8588
RecoveryServicesMgmtClient = GetRecoveryServicesManagementClient();
8689
SiteRecoveryMgmtClient = GetSiteRecoveryManagementClient();
8790

88-
helper.SetupManagementClients(RecoveryServicesMgmtClient, SiteRecoveryMgmtClient);
91+
helper.SetupManagementClients(CloudServiceManagementClient, RecoveryServicesMgmtClient, SiteRecoveryMgmtClient);
8992
}
9093

9194
protected void RunPowerShellTest(params string[] scripts)
@@ -98,17 +101,25 @@ protected void RunPowerShellTest(params string[] scripts)
98101

99102
SetupManagementClients();
100103

101-
helper.SetupEnvironment(AzureModule.AzureServiceManagement);
104+
helper.SetupEnvironment(AzureModule.AzureResourceManager);
102105
helper.SetupModules(AzureModule.AzureResourceManager,
103106
"ScenarioTests\\" + this.GetType().Name + ".ps1");
104107

105108
helper.RunPowerShellTest(scripts);
106109
}
107110
}
108111

112+
private CloudServiceManagementClient GetCloudServicesManagementClient()
113+
{
114+
return TestBase.GetServiceClient<CloudServiceManagementClient>(this.armTestFactory);
115+
}
116+
109117
private RecoveryServicesManagementClient GetRecoveryServicesManagementClient()
110118
{
111-
return TestBase.GetServiceClient<RecoveryServicesManagementClient>(this.armTestFactory);
119+
return new RecoveryServicesManagementClient(
120+
"Microsoft.SiteRecovery",
121+
CloudServiceManagementClient.Credentials,
122+
CloudServiceManagementClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
112123
}
113124

114125
private SiteRecoveryManagementClient GetSiteRecoveryManagementClient()
@@ -122,11 +133,11 @@ private SiteRecoveryManagementClient GetSiteRecoveryManagementClient()
122133
}
123134

124135
return new SiteRecoveryManagementClient(
125-
asrVaultCreds.ResourceGroupName,
126136
asrVaultCreds.ResourceName,
127137
asrVaultCreds.ResourceGroupName,
128-
RecoveryServicesMgmtClient.Credentials,
129-
RecoveryServicesMgmtClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
138+
"Microsoft.SiteRecovery",
139+
CloudServiceManagementClient.Credentials,
140+
CloudServiceManagementClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
130141
}
131142

132143
private static bool IgnoreCertificateErrorHandler
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<ASRVaultCreds xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Azure.Portal.RecoveryServices.Models.Common" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><SubscriptionId>00a07ea0-ad8b-491c-9de8-77bf10881499</SubscriptionId><ResourceType>HyperVRecoveryManagerVault</ResourceType><ResourceName>ppeVault2</ResourceName><ManagementCert></ManagementCert><AcsNamespace><HostName>accesscontrol.windows.net</HostName><Namespace>wusppe1rrp1users</Namespace><ResourceProviderRealm>http://windowscloudbackup/m3</ResourceProviderRealm></AcsNamespace><ChannelIntegrityKey>tmPfTki5UFSdaEq2JFvzuw==</ChannelIntegrityKey><ResourceGroupName>testsitegroup</ResourceGroupName><Version>1.0</Version></ASRVaultCreds>
1+
<ASRVaultCreds xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Azure.Portal.RecoveryServices.Models.Common" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><SubscriptionId>00a07ea0-ad8b-491c-9de8-77bf10881499</SubscriptionId><ResourceType>HyperVRecoveryManagerVault</ResourceType><ResourceName>ppeVault3</ResourceName><AcsNamespace><HostName>accesscontrol.windows.net</HostName><Namespace>wusppe1rrp1users</Namespace><ResourceProviderRealm>http://windowscloudbackup/m3</ResourceProviderRealm></AcsNamespace><ChannelIntegrityKey>46mwOXc2yrH0ObMi6CO7Ng==</ChannelIntegrityKey><ResourceGroupName>testsitegroup</ResourceGroupName><Version>1.0</Version></ASRVaultCreds>

0 commit comments

Comments
 (0)