Skip to content

Commit 0e8d939

Browse files
author
Samuel Anudeep
committed
Onboarding tests to Swagger + session records
Added time Filter negative test and session record for GetRP and GetJobTimeFilter Job Wait and Cancel records Merged GetRP and restore test to save run time. Added session record for GetRP and backup item test case. Added AzureVM Workload trait to tests Removing restore cmdlet call from getRP. Fixing MSI build break. Updated Client Request ID to include "-PS" Added "-PS" to client request ID Fixed namespaces Fixed container API bug and recorded MAB test cases Undoing changes to authentication csproj file Undoing changes to Commands Common csproj undoing changes to commands common csproj undoing changes to cognitive services sln undoing changes Undoing unwanted changes 1. Undoing unwated changes to csproj files and 2. Kept system using first Fixing build recording for Azure Sql PaaS workload cmdlets. Addressed CR comments Addressed CR comments Taken code guideline - every line should be 100 chars of less. Recorded DPM tests and added session records Fixing mistakes in comments Using aliases for namespaces wherever possible. namespace alias changes
1 parent a46a0cd commit 0e8d939

File tree

143 files changed

+197282
-23256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+197282
-23256
lines changed

src/Common/Commands.Common.Authentication/Commands.Common.Authentication.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@
7171
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
7272
<Private>True</Private>
7373
</Reference>
74-
<Reference Include="Microsoft.Rest.ClientRuntime">
74+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7575
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
76+
<Private>True</Private>
77+
</Reference>
78+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
79+
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.2\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
80+
<Private>True</Private>
7681
</Reference>
7782
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7883
<HintPath>..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
@@ -183,4 +188,4 @@
183188
<None Include="packages.config" />
184189
</ItemGroup>
185190
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
186-
</Project>
191+
</Project>

src/ResourceManager/CognitiveServices/CognitiveServices.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 14
3-
VisualStudioVersion = 14.0.25420.1
2+
# Visual Studio 2013
3+
VisualStudioVersion = 12.0.40629.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}"
66
EndProject
@@ -46,7 +46,6 @@ Global
4646
{E1F5201D-6067-430E-B303-4E367652991B}.Release|Any CPU.Build.0 = Release|Any CPU
4747
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4848
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
49-
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
5049
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
5150
{2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU
5251
{65C3A86A-716D-4E7D-AB67-1DB00B3BF72D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU

src/ResourceManager/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@
7777
<SpecificVersion>False</SpecificVersion>
7878
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
7979
</Reference>
80-
<Reference Include="Microsoft.Rest.ClientRuntime">
80+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8181
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
82+
<Private>True</Private>
8283
</Reference>
83-
<Reference Include="Microsoft.Rest.ClientRuntime.Azure">
84+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8485
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.2\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
86+
<Private>True</Private>
8587
</Reference>
8688
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8789
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@
7171
<SpecificVersion>False</SpecificVersion>
7272
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
7373
</Reference>
74-
<Reference Include="Microsoft.Rest.ClientRuntime">
74+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7575
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
76+
<Private>True</Private>
7677
</Reference>
77-
<Reference Include="Microsoft.Rest.ClientRuntime.Azure">
78+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7879
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.2\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
80+
<Private>True</Private>
7981
</Reference>
8082
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8183
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
@@ -199,4 +201,4 @@
199201
</ItemGroup>
200202
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
201203
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
202-
</Project>
204+
</Project>

src/ResourceManager/Profile/Commands.Profile/Commands.Profile.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<Private>True</Private>
7373
</Reference>
7474
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
75-
<SpecificVersion>False</SpecificVersion>
7675
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
76+
<Private>True</Private>
7777
</Reference>
7878
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7979
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
<Reference Include="Microsoft.Azure.Common">
4141
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
4242
</Reference>
43-
<Reference Include="Microsoft.Azure.Management.RecoveryServices.Backup, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43+
<Reference Include="Microsoft.Azure.Management.RecoveryServices.Backup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4444
<SpecificVersion>False</SpecificVersion>
45-
<HintPath>..\..\..\tempDll\Debug-Net45\net45\Microsoft.Azure.Management.RecoveryServices.Backup.dll</HintPath>
45+
<HintPath>..\..\..\tempDll\Debug\net45\Microsoft.Azure.Management.RecoveryServices.Backup.dll</HintPath>
4646
</Reference>
4747
<Reference Include="Microsoft.Rest.ClientRuntime">
4848
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
@@ -64,6 +64,7 @@
6464
<ItemGroup>
6565
<Compile Include="Conversions\JobConversions.cs" />
6666
<Compile Include="Conversions\RecoveryPointConversions.cs" />
67+
<Compile Include="Extensions\EnumExtensions.cs" />
6768
<Compile Include="Extensions\HttpHeadersExtensions.cs" />
6869
<Compile Include="HelperUtils.cs" />
6970
<Compile Include="TrackingHelpers.cs" />

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/ConversionHelpers.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414

1515
using System;
1616
using System.Collections.Generic;
17-
using System.Linq;
18-
using System.Text;
19-
using System.Threading.Tasks;
2017
using Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
21-
using CmdletModels = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
2218
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
2319
using ServiceClientModel = Microsoft.Azure.Management.RecoveryServices.Backup.Models;
2420

@@ -62,15 +58,17 @@ public static ContainerBase GetContainerModel(ServiceClientModel.ProtectionConta
6258
/// <summary>
6359
/// Helper function to convert ps backup engine model from service response.
6460
/// </summary>
65-
public static BackupEngineBase GetBackupEngineModel(ServiceClientModel.BackupEngineBaseResource backupEngine)
61+
public static BackupEngineBase GetBackupEngineModel(
62+
ServiceClientModel.BackupEngineBaseResource backupEngine)
6663
{
6764
BackupEngineBase backupEngineModel = null;
6865

6966
if (backupEngine != null &&
7067
backupEngine.Properties != null)
7168
{
7269
string friendlyName = backupEngine.Properties.FriendlyName;
73-
string backupManagementType = backupEngine.Properties.BackupManagementType.ToString();
70+
string backupManagementType =
71+
backupEngine.Properties.BackupManagementType.ToString();
7472
string registrationStatus = backupEngine.Properties.RegistrationStatus;
7573
string healthStatus = backupEngine.Properties.HealthStatus;
7674
bool? canReRegister = backupEngine.Properties.CanReRegister;
@@ -107,7 +105,8 @@ public static List<ContainerBase> GetContainerModelList(IEnumerable<ServiceClien
107105
/// <summary>
108106
/// Helper function to convert ps backup engine model list from service response.
109107
/// </summary>
110-
public static List<BackupEngineBase> GetBackupEngineModelList(IEnumerable<ServiceClientModel.BackupEngineBaseResource> backupEngines)
108+
public static List<BackupEngineBase> GetBackupEngineModelList(
109+
IEnumerable<ServiceClientModel.BackupEngineBaseResource> backupEngines)
111110
{
112111
List<BackupEngineBase> backupEngineModel = new List<BackupEngineBase>();
113112

@@ -158,8 +157,8 @@ public static PolicyBase GetPolicyModel(ServiceClientModel.ProtectionPolicyResou
158157

159158
policyModel = new AzureVmPolicy();
160159
AzureVmPolicy iaasPolicyModel = policyModel as AzureVmPolicy;
161-
iaasPolicyModel.WorkloadType = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType.AzureVM;
162-
iaasPolicyModel.BackupManagementType = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.BackupManagementType.AzureVM;
160+
iaasPolicyModel.WorkloadType = WorkloadType.AzureVM;
161+
iaasPolicyModel.BackupManagementType = BackupManagementType.AzureVM;
163162
iaasPolicyModel.RetentionPolicy = PolicyHelpers.GetPSLongTermRetentionPolicy((ServiceClientModel.LongTermRetentionPolicy)
164163
((ServiceClientModel.AzureIaaSVMProtectionPolicy)serviceClientResponse.Properties).RetentionPolicy);
165164
iaasPolicyModel.SchedulePolicy = PolicyHelpers.GetPSSimpleSchedulePolicy((ServiceClientModel.SimpleSchedulePolicy)
@@ -182,8 +181,8 @@ public static PolicyBase GetPolicyModel(ServiceClientModel.ProtectionPolicyResou
182181

183182
policyModel = new AzureSqlPolicy();
184183
AzureSqlPolicy sqlPolicyModel = policyModel as AzureSqlPolicy;
185-
sqlPolicyModel.WorkloadType = CmdletModels.WorkloadType.AzureSQLDatabase;
186-
sqlPolicyModel.BackupManagementType = CmdletModels.BackupManagementType.AzureSQL;
184+
sqlPolicyModel.WorkloadType = WorkloadType.AzureSQLDatabase;
185+
sqlPolicyModel.BackupManagementType = BackupManagementType.AzureSQL;
187186

188187
ServiceClientModel.SimpleRetentionPolicy azureSqlRetentionPolicy =
189188
(ServiceClientModel.SimpleRetentionPolicy)azureSqlPolicy.RetentionPolicy;
@@ -221,7 +220,8 @@ public static List<PolicyBase> GetPolicyModelList(
221220
List<PolicyBase> policyModels = new List<PolicyBase>();
222221
PolicyBase policyModel = null;
223222

224-
foreach (ServiceClientModel.ProtectionPolicyResource resource in serviceClientListResponse)
223+
foreach (ServiceClientModel.ProtectionPolicyResource resource
224+
in serviceClientListResponse)
225225
{
226226
policyModel = GetPolicyModel(resource);
227227
if (policyModel != null)
@@ -266,7 +266,7 @@ public static ItemBase GetItemModel(ServiceClientModel.ProtectedItemResource pro
266266
itemModel = new AzureVmItem(
267267
protectedItem,
268268
IdUtils.GetNameFromUri(containerUri),
269-
Cmdlets.Models.ContainerType.AzureVM,
269+
ContainerType.AzureVM,
270270
policyName);
271271
}
272272

@@ -277,7 +277,7 @@ public static ItemBase GetItemModel(ServiceClientModel.ProtectedItemResource pro
277277
(ServiceClientModel.AzureSqlProtectedItem)protectedItem.Properties;
278278
string policyName = null;
279279
string policyId = azureSqlProtectedItem.PolicyId;
280-
if (!String.IsNullOrEmpty(policyId))
280+
if (!string.IsNullOrEmpty(policyId))
281281
{
282282
Dictionary<UriEnums, string> keyVauleDict =
283283
HelperUtils.ParseUri(policyId);
@@ -291,7 +291,7 @@ public static ItemBase GetItemModel(ServiceClientModel.ProtectedItemResource pro
291291
itemModel = new AzureSqlItem(
292292
protectedItem,
293293
IdUtils.GetNameFromUri(containerUri),
294-
Cmdlets.Models.ContainerType.AzureSQL,
294+
ContainerType.AzureSQL,
295295
policyName);
296296
}
297297
}

src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/Conversions/JobConversions.cs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
using System;
1616
using System.Collections.Generic;
17-
using CmdletModel = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
18-
using Microsoft.Azure.Management.RecoveryServices.Backup.Models;
1917
using Microsoft.Azure.Commands.RecoveryServices.Backup.Properties;
18+
using Microsoft.Azure.Management.RecoveryServices.Backup.Models;
19+
using CmdletModel = Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models;
2020

2121
namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers
2222
{
@@ -27,19 +27,6 @@ public class JobConversions
2727
{
2828
#region ServiceClient to PS convertors
2929

30-
/// <summary>
31-
/// This function returns either job object or job details object based on
32-
/// what ServiceClient object contains.
33-
/// To elaborate, if ServiceClient job's ExtendedInfo is filled then this function will
34-
/// return a job details object. Otherwise it will return a job object.
35-
/// </summary>
36-
/// <param name="ServiceClientJob"></param>
37-
/// <returns></returns>
38-
//public static CmdletModel.JobBase GetPSJob(JobResponse serviceClientJob)
39-
//{
40-
// return GetPSJob(serviceClientJob.Item);
41-
//}
42-
4330
/// <summary>
4431
/// Helper function to convert ps backup job model from service response.
4532
/// </summary>
@@ -63,7 +50,10 @@ public static CmdletModel.JobBase GetPSJob(JobResource serviceClientJob)
6350
/// <summary>
6451
/// Helper function to convert ps backup job list model from service response.
6552
/// </summary>
66-
public static void AddServiceClientJobsToPSList(List<JobResource> serviceClientJobs, List<CmdletModel.JobBase> psJobs, ref int jobsCount)
53+
public static void AddServiceClientJobsToPSList(
54+
List<JobResource> serviceClientJobs,
55+
List<CmdletModel.JobBase> psJobs,
56+
ref int jobsCount)
6757
{
6858
if (serviceClientJobs != null )
6959
{
@@ -77,7 +67,8 @@ public static void AddServiceClientJobsToPSList(List<JobResource> serviceClientJ
7767
}
7868
else
7969
{
80-
Logger.Instance.WriteDebug("Ignoring some of the unexpected job while conversion");
70+
Logger.Instance.WriteDebug(
71+
"Ignoring some of the unexpected job while conversion");
8172
}
8273
}
8374
}
@@ -114,7 +105,8 @@ private static CmdletModel.AzureVmJob GetPSAzureVmJob(JobResource serviceClientJ
114105
throw new ArgumentNullException("Job Start Time is null");
115106
}
116107
response.EndTime = vmJob.EndTime;
117-
response.Duration = vmJob.Duration.HasValue ? (TimeSpan)vmJob.Duration : default(TimeSpan);
108+
response.Duration =
109+
vmJob.Duration.HasValue ? (TimeSpan)vmJob.Duration : default(TimeSpan);
118110
response.Status = vmJob.Status;
119111
response.VmVersion = vmJob.VirtualMachineVersion;
120112
response.WorkloadName = vmJob.EntityFriendlyName;
@@ -201,7 +193,8 @@ public static string GetLastIdFromFullId(string fullId)
201193
/// <summary>
202194
/// Helper function to get job type from ps backup management type.
203195
/// </summary>
204-
public static BackupManagementType GetJobTypeForService(CmdletModel.BackupManagementType mgmtType)
196+
public static BackupManagementType GetJobTypeForService(
197+
CmdletModel.BackupManagementType mgmtType)
205198
{
206199
switch (mgmtType)
207200
{

0 commit comments

Comments
 (0)