-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from MabOneSdk/panbha5
BackUpAndRecoveryScenario
- Loading branch information
Showing
6 changed files
with
229 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/ResourceManagement/AzureBackup/BackupServices.Tests/ScenarioTests/BackUpTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.Azure.Management.BackupServices.Models; | ||
using Microsoft.Azure.Management.BackupServices; | ||
using Microsoft.Azure.Test; | ||
using System.Net; | ||
using Xunit; | ||
using System.Configuration; | ||
using System; | ||
|
||
namespace BackupServices.Tests | ||
{ | ||
public class BackUpTests : BackupServicesTestsBase | ||
{ | ||
[Fact] | ||
public void TriggerBackUpTest() | ||
{ | ||
using (UndoContext context = UndoContext.Current) | ||
{ | ||
context.Start(); | ||
var client = GetServiceClient<BackupServicesManagementClient>(); | ||
|
||
string containerName = ConfigurationManager.AppSettings["ContainerName"]; | ||
string dataSourceType = ConfigurationManager.AppSettings["DataSourceType"]; | ||
string dataSourceId = ConfigurationManager.AppSettings["DataSourceId"]; | ||
|
||
var response = client.BackUp.TriggerBackUp(GetCustomRequestHeaders(), containerName, dataSourceType, dataSourceId); | ||
|
||
|
||
/* | ||
foreach (var ppo in response.RecoveryPoints.Objects) | ||
{ | ||
Assert.True(!string.IsNullOrEmpty(ppo.InstanceId), "RecoveryPointId can't be null or empty"); | ||
Assert.True((ppo.RecoveryPointTime != null), "RecoveryPointTime can't be null or empty"); | ||
Assert.True(!string.IsNullOrEmpty(ppo.RecoveryPointType), "RecoveryPointType can't be null or empty"); | ||
} | ||
*/ | ||
Assert.Equal(HttpStatusCode.Accepted, response.StatusCode); | ||
} | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/ResourceManagement/AzureBackup/BackupServices.Tests/ScenarioTests/RecoveryPointTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.Azure.Management.BackupServices.Models; | ||
using Microsoft.Azure.Management.BackupServices; | ||
using Microsoft.Azure.Test; | ||
using System.Net; | ||
using Xunit; | ||
using System.Configuration; | ||
using System; | ||
|
||
namespace BackupServices.Tests | ||
{ | ||
public class RecoveryPointTests : BackupServicesTestsBase | ||
{ | ||
[Fact] | ||
public void ListRecoveryPointTest() | ||
{ | ||
using (UndoContext context = UndoContext.Current) | ||
{ | ||
context.Start(); | ||
var client = GetServiceClient<BackupServicesManagementClient>(); | ||
|
||
string containerName = ConfigurationManager.AppSettings["ContainerName"]; | ||
string dataSourceType = ConfigurationManager.AppSettings["DataSourceType"]; | ||
string dataSourceId = ConfigurationManager.AppSettings["DataSourceId"]; | ||
|
||
var response = client.RecoveryPoint.List(GetCustomRequestHeaders(), containerName, dataSourceType, dataSourceId); | ||
|
||
Assert.True(response.RecoveryPoints.ResultCount > 0, "Recovery Points Result count can't be less than 1"); | ||
|
||
foreach (var ppo in response.RecoveryPoints.Objects) | ||
{ | ||
Assert.True(!string.IsNullOrEmpty(ppo.InstanceId), "RecoveryPointId can't be null or empty"); | ||
Assert.True((ppo.RecoveryPointTime != null), "RecoveryPointTime can't be null or empty"); | ||
Assert.True(!string.IsNullOrEmpty(ppo.RecoveryPointType), "RecoveryPointType can't be null or empty"); | ||
} | ||
|
||
Assert.Equal(HttpStatusCode.OK, response.StatusCode); | ||
} | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...ckupServices.Tests/SessionRecords/BackupServices.Tests.BackUpTests/TriggerBackUpTest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"Entries": [ | ||
{ | ||
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backupseadev01/BackupVault/backuprn/containers/iaasvmcontainer%3Bdev01testing%3Bdev01testing/datasources/VM/17593283453810/backup?api-version=2014-09-01", | ||
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3Vwc2VhZGV2MDEvQmFja3VwVmF1bHQvYmFja3Vwcm4vY29udGFpbmVycy9pYWFzdm1jb250YWluZXIlM0JkZXYwMXRlc3RpbmclM0JkZXYwMXRlc3RpbmcvZGF0YXNvdXJjZXMvVk0vMTc1OTMyODM0NTM4MTAvYmFja3VwP2FwaS12ZXJzaW9uPTIwMTQtMDktMDE=", | ||
"RequestMethod": "POST", | ||
"RequestBody": "", | ||
"RequestHeaders": { | ||
"Accept-Language": [ | ||
"en-us" | ||
], | ||
"User-Agent": [ | ||
"Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" | ||
] | ||
}, | ||
"ResponseBody": "\"47ac4ee3-a249-4d8d-b737-b67bd0d9ada1\"", | ||
"ResponseHeaders": { | ||
"Content-Length": [ | ||
"38" | ||
], | ||
"Content-Type": [ | ||
"application/json" | ||
], | ||
"Expires": [ | ||
"-1" | ||
], | ||
"Pragma": [ | ||
"no-cache" | ||
], | ||
"x-ms-request-id": [ | ||
"959bc754-f55e-461b-aeff-d32b56c6218d" | ||
], | ||
"x-ms-client-request-id": [ | ||
"380700e8-5f65-4790-b6a9-77085f633b6d", | ||
"380700e8-5f65-4790-b6a9-77085f633b6d" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000; includeSubDomains" | ||
], | ||
"x-ms-ratelimit-remaining-subscription-writes": [ | ||
"1199" | ||
], | ||
"x-ms-correlation-request-id": [ | ||
"959bc754-f55e-461b-aeff-d32b56c6218d" | ||
], | ||
"x-ms-routing-request-id": [ | ||
"CENTRALUS:20150611T105041Z:959bc754-f55e-461b-aeff-d32b56c6218d" | ||
], | ||
"Cache-Control": [ | ||
"no-cache" | ||
], | ||
"Date": [ | ||
"Thu, 11 Jun 2015 10:50:40 GMT" | ||
], | ||
"Server": [ | ||
"Microsoft-IIS/8.0" | ||
], | ||
"X-Powered-By": [ | ||
"ASP.NET" | ||
] | ||
}, | ||
"StatusCode": 202 | ||
} | ||
], | ||
"Names": {}, | ||
"Variables": { | ||
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26" | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...s.Tests/SessionRecords/BackupServices.Tests.RecoveryPointTests/ListRecoveryPointTest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"Entries": [ | ||
{ | ||
"RequestUri": "/Subscriptions/f5303a0b-fae4-4cdb-b44d-0e4c032dde26/resourceGroups/backuprg/providers/Microsoft.Backupseadev01/BackupVault/backuprn/containers/iaasvmcontainer%3Bdev01testing%3Bdev01testing/datasources/VM/17593283453810/recoverypoints?api-version=2014-09-01", | ||
"EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjUzMDNhMGItZmFlNC00Y2RiLWI0NGQtMGU0YzAzMmRkZTI2L3Jlc291cmNlR3JvdXBzL2JhY2t1cHJnL3Byb3ZpZGVycy9NaWNyb3NvZnQuQmFja3Vwc2VhZGV2MDEvQmFja3VwVmF1bHQvYmFja3Vwcm4vY29udGFpbmVycy9pYWFzdm1jb250YWluZXIlM0JkZXYwMXRlc3RpbmclM0JkZXYwMXRlc3RpbmcvZGF0YXNvdXJjZXMvVk0vMTc1OTMyODM0NTM4MTAvcmVjb3Zlcnlwb2ludHM/YXBpLXZlcnNpb249MjAxNC0wOS0wMQ==", | ||
"RequestMethod": "GET", | ||
"RequestBody": "", | ||
"RequestHeaders": { | ||
"Accept-Language": [ | ||
"en-us" | ||
], | ||
"User-Agent": [ | ||
"Microsoft.Azure.Management.BackupServices.BackupServicesManagementClient/0.0.0.0" | ||
] | ||
}, | ||
"ResponseBody": "{\r\n \"Objects\": [\r\n {\r\n \"RecoveryPointType\": \"AppConsistent\",\r\n \"RecoveryPointTime\": \"2015-06-11T10:52:30.0345282Z\",\r\n \"RecoveryPointAdditionalInfo\": \"\",\r\n \"InstanceId\": \"19591702463836\",\r\n \"Name\": null,\r\n \"OperationInProgress\": false\r\n }\r\n ],\r\n \"ResultCount\": 1,\r\n \"Skiptoken\": null\r\n}", | ||
"ResponseHeaders": { | ||
"Content-Length": [ | ||
"238" | ||
], | ||
"Content-Type": [ | ||
"application/json" | ||
], | ||
"Expires": [ | ||
"-1" | ||
], | ||
"Pragma": [ | ||
"no-cache" | ||
], | ||
"x-ms-request-id": [ | ||
"309bda36-8fc0-4708-ac3c-3ba1a6dd791e" | ||
], | ||
"x-ms-client-request-id": [ | ||
"750381bf-21f7-4a9c-b4db-d0a4dbfc86f9", | ||
"750381bf-21f7-4a9c-b4db-d0a4dbfc86f9" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000; includeSubDomains" | ||
], | ||
"x-ms-ratelimit-remaining-subscription-reads": [ | ||
"14999" | ||
], | ||
"x-ms-correlation-request-id": [ | ||
"309bda36-8fc0-4708-ac3c-3ba1a6dd791e" | ||
], | ||
"x-ms-routing-request-id": [ | ||
"CENTRALUS:20150611T114322Z:309bda36-8fc0-4708-ac3c-3ba1a6dd791e" | ||
], | ||
"Cache-Control": [ | ||
"no-cache" | ||
], | ||
"Date": [ | ||
"Thu, 11 Jun 2015 11:43:21 GMT" | ||
], | ||
"Server": [ | ||
"Microsoft-IIS/8.0" | ||
], | ||
"X-Powered-By": [ | ||
"ASP.NET" | ||
] | ||
}, | ||
"StatusCode": 200 | ||
} | ||
], | ||
"Names": {}, | ||
"Variables": { | ||
"SubscriptionId": "f5303a0b-fae4-4cdb-b44d-0e4c032dde26" | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
src/ResourceManagement/AzureBackup/BackupServices.Tests/app.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters