Skip to content

Site Recovery (ARM) PS changes #770

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 7 commits into from Aug 19, 2015
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
80 changes: 76 additions & 4 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.1.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.SiteRecovery, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.0-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.SiteRecovery.0.1.1-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Hyak.Common">
Expand Down Expand Up @@ -87,6 +87,10 @@
<Reference Include="Microsoft.WindowsAzure.Management">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.2.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Testing, Version=1.0.5417.13285, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.WindowsAzure.Management.Scheduler;
using Microsoft.Azure.Management.RecoveryServices;
using Microsoft.Azure.Management.SiteRecovery;
using Microsoft.Azure.Test;
Expand All @@ -41,6 +42,7 @@ public abstract class SiteRecoveryTestsBase

public SiteRecoveryManagementClient SiteRecoveryMgmtClient { get; private set; }
public RecoveryServicesManagementClient RecoveryServicesMgmtClient { get; private set; }
public CloudServiceManagementClient CloudServiceManagementClient { get; private set; }

protected SiteRecoveryTestsBase()
{
Expand Down Expand Up @@ -82,10 +84,11 @@ protected SiteRecoveryTestsBase()

protected void SetupManagementClients()
{
CloudServiceManagementClient = GetCloudServicesManagementClient();
RecoveryServicesMgmtClient = GetRecoveryServicesManagementClient();
SiteRecoveryMgmtClient = GetSiteRecoveryManagementClient();

helper.SetupManagementClients(RecoveryServicesMgmtClient, SiteRecoveryMgmtClient);
helper.SetupManagementClients(CloudServiceManagementClient, RecoveryServicesMgmtClient, SiteRecoveryMgmtClient);
}

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

SetupManagementClients();

helper.SetupEnvironment(AzureModule.AzureServiceManagement);
helper.SetupEnvironment(AzureModule.AzureResourceManager);
helper.SetupModules(AzureModule.AzureResourceManager,
"ScenarioTests\\" + this.GetType().Name + ".ps1");

helper.RunPowerShellTest(scripts);
}
}

private CloudServiceManagementClient GetCloudServicesManagementClient()
{
return TestBase.GetServiceClient<CloudServiceManagementClient>(this.armTestFactory);
}

private RecoveryServicesManagementClient GetRecoveryServicesManagementClient()
{
return TestBase.GetServiceClient<RecoveryServicesManagementClient>(this.armTestFactory);
return new RecoveryServicesManagementClient(
"Microsoft.SiteRecovery",
CloudServiceManagementClient.Credentials,
CloudServiceManagementClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
}

private SiteRecoveryManagementClient GetSiteRecoveryManagementClient()
Expand All @@ -122,11 +133,11 @@ private SiteRecoveryManagementClient GetSiteRecoveryManagementClient()
}

return new SiteRecoveryManagementClient(
asrVaultCreds.ResourceGroupName,
asrVaultCreds.ResourceName,
asrVaultCreds.ResourceGroupName,
RecoveryServicesMgmtClient.Credentials,
RecoveryServicesMgmtClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
"Microsoft.SiteRecovery",
CloudServiceManagementClient.Credentials,
CloudServiceManagementClient.BaseUri).WithHandler(HttpMockServer.CreateInstance());
}

private static bool IgnoreCertificateErrorHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
<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>
Loading