Skip to content

Commit 965764b

Browse files
committed
tests for ARM SiteRecovery
1 parent 36665a4 commit 965764b

File tree

16 files changed

+4803
-18
lines changed

16 files changed

+4803
-18
lines changed

src/AzurePowershell.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup.Test",
230230
EndProject
231231
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery", "ResourceManager\SiteRecovery\Commands.SiteRecovery\Commands.SiteRecovery.csproj", "{7C879645-31EE-4A78-AD81-5512300FA104}"
232232
EndProject
233+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery.Test", "ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\Commands.SiteRecovery.Test.csproj", "{6C7D3D81-37AB-445E-8081-78A1FEC0A773}"
234+
EndProject
233235
Global
234236
GlobalSection(SolutionConfigurationPlatforms) = preSolution
235237
Debug|Any CPU = Debug|Any CPU
@@ -576,6 +578,10 @@ Global
576578
{7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.Build.0 = Debug|Any CPU
577579
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.ActiveCfg = Release|Any CPU
578580
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.Build.0 = Release|Any CPU
581+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
582+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.Build.0 = Debug|Any CPU
583+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.ActiveCfg = Release|Any CPU
584+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.Build.0 = Release|Any CPU
579585
EndGlobalSection
580586
GlobalSection(SolutionProperties) = preSolution
581587
HideSolutionNode = FALSE
@@ -622,5 +628,6 @@ Global
622628
{F220C306-29A3-4511-8518-A58A55C60D07} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
623629
{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
624630
{678AE95D-2364-47D7-888C-3FFA6D412CC8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
631+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
625632
EndGlobalSection
626633
EndGlobal
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6C7D3D81-37AB-445E-8081-78A1FEC0A773}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Commands.SiteRecovery.Test</RootNamespace>
11+
<AssemblyName>Commands.SiteRecovery.Test</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
15+
<RestorePackages>true</RestorePackages>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
36+
<SpecificVersion>False</SpecificVersion>
37+
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.0.27-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
38+
</Reference>
39+
<Reference Include="Microsoft.Azure.Management.SiteRecovery, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
40+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.RecoveryServicesARM.0.0.22-preview\lib\net40\Microsoft.Azure.Management.SiteRecovery.dll</HintPath>
41+
<Private>True</Private>
42+
</Reference>
43+
<Reference Include="Microsoft.Azure.ResourceManager">
44+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Microsoft.Azure.Utilities.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47+
</Reference>
48+
<Reference Include="Hyak.Common">
49+
<HintPath>..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Microsoft.Azure.Common">
52+
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
53+
</Reference>
54+
<Reference Include="Microsoft.Azure.Common.NetFramework">
55+
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
56+
</Reference>
57+
<Reference Include="Microsoft.Azure.Test.Framework">
58+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
59+
</Reference>
60+
<Reference Include="Microsoft.Azure.Test.HttpRecorder">
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
62+
</Reference>
63+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
64+
<SpecificVersion>False</SpecificVersion>
65+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
68+
<SpecificVersion>False</SpecificVersion>
69+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
70+
</Reference>
71+
<Reference Include="Microsoft.Threading.Tasks">
72+
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
73+
</Reference>
74+
<Reference Include="Microsoft.Threading.Tasks.Extensions">
75+
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
76+
</Reference>
77+
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
78+
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
79+
</Reference>
80+
<Reference Include="Microsoft.WindowsAzure.Management">
81+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
82+
</Reference>
83+
<Reference Include="Microsoft.WindowsAzure.Testing, Version=1.0.5417.13285, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84+
<SpecificVersion>False</SpecificVersion>
85+
<HintPath>..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll</HintPath>
86+
</Reference>
87+
<Reference Include="Newtonsoft.Json">
88+
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
89+
</Reference>
90+
<Reference Include="System" />
91+
<Reference Include="System.Core" />
92+
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
93+
<SpecificVersion>False</SpecificVersion>
94+
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
95+
</Reference>
96+
<Reference Include="System.Net" />
97+
<Reference Include="System.Net.Http" />
98+
<Reference Include="System.Net.Http.Extensions">
99+
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Extensions.dll</HintPath>
100+
<Private>True</Private>
101+
</Reference>
102+
<Reference Include="System.Net.Http.Primitives">
103+
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
104+
<Private>True</Private>
105+
</Reference>
106+
<Reference Include="System.Net.Http.WebRequest" />
107+
<Reference Include="System.Runtime.Serialization" />
108+
<Reference Include="System.Xml.Linq" />
109+
<Reference Include="System.Data.DataSetExtensions" />
110+
<Reference Include="Microsoft.CSharp" />
111+
<Reference Include="System.Data" />
112+
<Reference Include="System.Xml" />
113+
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
114+
<SpecificVersion>False</SpecificVersion>
115+
<HintPath>..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
116+
</Reference>
117+
<Reference Include="xunit.extensions">
118+
<HintPath>..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
119+
</Reference>
120+
</ItemGroup>
121+
<ItemGroup>
122+
<Compile Include="Properties\AssemblyInfo.cs" />
123+
<Compile Include="ScenarioTests\SiteRecoveryTests.cs" />
124+
<Compile Include="ScenarioTests\SiteRecoveryTestsBase.cs" />
125+
</ItemGroup>
126+
<ItemGroup>
127+
<None Include="packages.config" />
128+
<None Include="ScenarioTests\SiteRecoveryTests.ps1">
129+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
130+
</None>
131+
<None Include="ScenarioTests\vaultSettings.VaultCredentials">
132+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
133+
</None>
134+
<None Include="SessionRecords\Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests\EnumerationTests.json">
135+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
136+
</None>
137+
<None Include="SessionRecords\Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests\TestAssociateProfile.json">
138+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
139+
</None>
140+
<None Include="SessionRecords\Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests\TestCreateProfile.json">
141+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
142+
</None>
143+
<None Include="SessionRecords\Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests\TestDeleteProfile.json">
144+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
145+
</None>
146+
<None Include="SessionRecords\Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests.SiteRecoveryTests\TestDissociateProfile.json">
147+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
148+
</None>
149+
</ItemGroup>
150+
<ItemGroup>
151+
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
152+
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
153+
<Name>Commands.Common</Name>
154+
</ProjectReference>
155+
<ProjectReference Include="..\..\..\Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj">
156+
<Project>{c1bda476-a5cc-4394-914d-48b0ec31a710}</Project>
157+
<Name>Commands.ScenarioTests.Common</Name>
158+
</ProjectReference>
159+
<ProjectReference Include="..\Commands.SiteRecovery\Commands.SiteRecovery.csproj">
160+
<Project>{7c879645-31ee-4a78-ad81-5512300fa104}</Project>
161+
<Name>Commands.SiteRecovery</Name>
162+
</ProjectReference>
163+
</ItemGroup>
164+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
165+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
166+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
167+
<PropertyGroup>
168+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
169+
</PropertyGroup>
170+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
171+
<Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
172+
</Target>
173+
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
174+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
175+
Other similar extension points exist, see Microsoft.Common.targets.
176+
<Target Name="BeforeBuild">
177+
</Target>
178+
<Target Name="AfterBuild">
179+
</Target>
180+
-->
181+
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Commands.SiteRecovery.Test")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Hewlett-Packard Company")]
12+
[assembly: AssemblyProduct("Commands.SiteRecovery.Test")]
13+
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("53c5f637-216c-44d5-ab19-c133cf33bb8d")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
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+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.SiteRecovery.Test.ScenarioTests
19+
{
20+
public class SiteRecoveryTests : SiteRecoveryTestsBase
21+
{
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void EnumerationTests()
25+
{
26+
this.RunPowerShellTest("Test-SiteRecoveryEnumerationTests -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\"");
27+
}
28+
29+
[Fact]
30+
[Trait(Category.AcceptanceType, Category.CheckIn)]
31+
public void TestCreateProfile()
32+
{
33+
this.RunPowerShellTest("Test-SiteRecoveryCreateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\"");
34+
}
35+
36+
[Fact]
37+
[Trait(Category.AcceptanceType, Category.CheckIn)]
38+
public void TestDeleteProfile()
39+
{
40+
this.RunPowerShellTest("Test-SiteRecoveryDeleteProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\"");
41+
}
42+
43+
[Fact]
44+
[Trait(Category.AcceptanceType, Category.CheckIn)]
45+
public void TestAssociateProfile()
46+
{
47+
this.RunPowerShellTest("Test-SiteRecoveryAssociateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\"");
48+
}
49+
50+
[Fact]
51+
[Trait(Category.AcceptanceType, Category.CheckIn)]
52+
public void TestDissociateProfile()
53+
{
54+
this.RunPowerShellTest("Test-SiteRecoveryDissociateProfile -vaultSettingsFilePath \"" + vaultSettingsFilePath + "\"");
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)