Skip to content

Commit b4fb4ea

Browse files
authored
Added support for updating CrossSubscriptionRestoreState of the vault (#21583)
* Added support for updating CrossSubscriptionRestoreState of the vault Added Cross subscription restore support for workload type MSSQL * added new testcase * Re-recorded backup test cases Updated ASR tests Generated site-recovery SDK updated failed tests
1 parent 26f68cb commit b4fb4ea

File tree

259 files changed

+96952
-157625
lines changed

Some content is hidden

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

259 files changed

+96952
-157625
lines changed

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/AzureWorkload/ItemTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,17 @@ public void TestAzureVmWorkloadRestoreAsFiles()
145145
"Test-AzureVmWorkloadRestoreAsFiles"
146146
);
147147
}
148+
149+
[Fact]
150+
[Trait(Category.AcceptanceType, Category.CheckIn)]
151+
[Trait(TestConstants.Workload, TestConstants.AzureVmWorkload)]
152+
public void TestAzureVmWorkloadCrossSubscriptionRestore()
153+
{
154+
TestRunner.RunTestScript(
155+
$"Import-Module {_AzureWorkloadcommonModule.AsAbsoluteLocation()}",
156+
$"Import-Module {_AzureWorkloadtestModule.AsAbsoluteLocation()}",
157+
"Test-AzureVmWorkloadCrossSubscriptionRestore"
158+
);
159+
}
148160
}
149161
}

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/AzureWorkload/ItemTests.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@ $resourceIdForFileDB = $resourceId
2222
$policyName = "HourlyLogBackup"
2323
$instanceName = "sqlinstance;mssqlserver"
2424

25+
function Test-AzureVmWorkloadCrossSubscriptionRestore
26+
{
27+
$resourceGroupName = "sqlcontainer-pstest-rg"
28+
$vaultName = "sqlcontainer-pstest-vault"
29+
$location = "centraluseuap"
30+
31+
try
32+
{
33+
$vault = Get-AzRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName
34+
Assert-True { $vault.Properties.RestoreSettings.CrossSubscriptionRestoreSettings.CrossSubscriptionRestoreState -eq "Enabled" }
35+
36+
# Disable/Enable CSR state
37+
$vault = Update-AzRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName -CrossSubscriptionRestoreState Disabled
38+
Assert-True { $vault.Properties.RestoreSettings.CrossSubscriptionRestoreSettings.CrossSubscriptionRestoreState -eq "Disabled" }
39+
}
40+
finally
41+
{
42+
$vault = Update-AzRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName -CrossSubscriptionRestoreState Enabled
43+
Assert-True { $vault.Properties.RestoreSettings.CrossSubscriptionRestoreSettings.CrossSubscriptionRestoreState -eq "Enabled" }
44+
}
45+
}
46+
2547
function Test-AzureVmWorkloadProtectableItem
2648
{
2749
try

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void TestAzureVMGetItems()
3636
);
3737
}
3838

39-
[Fact]
39+
[Fact(Skip = "Skipping for this release because backup job is taking hours of time.")]
4040
[Trait(Category.AcceptanceType, Category.CheckIn)]
4141
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
4242
public void TestAzureVMProtection()
@@ -60,7 +60,7 @@ public void TestAzureVMBackup()
6060
);
6161
}
6262

63-
[Fact]
63+
[Fact(Skip = "Skipping for this release because backup job is taking hours of time.")]
6464
[Trait(Category.AcceptanceType, Category.CheckIn)]
6565
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
6666
public void TestAzureVMGetRPs()
@@ -72,7 +72,7 @@ public void TestAzureVMGetRPs()
7272
);
7373
}
7474

75-
[Fact]
75+
[Fact(Skip = "Skipping for this release because backup job is taking hours of time.")]
7676
[Trait(Category.AcceptanceType, Category.CheckIn)]
7777
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
7878
public void TestAzureVMFullRestore()
@@ -124,7 +124,7 @@ public void TestAzureVMRPMountScript()
124124
//Assert.True(AzureSession.Instance.DataStore.FileExists(mountScriptDetails.FilePath));
125125
}
126126

127-
[Fact]
127+
[Fact(Skip = "Skipping for this release because backup job is taking hours of time.")]
128128
[Trait(Category.AcceptanceType, Category.CheckIn)]
129129
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
130130
public void TestAzureVMSetVaultContext()
@@ -196,7 +196,7 @@ public void TestAzureVMCrossRegionRestore()
196196
);
197197
}
198198

199-
[Fact(Skip = "to be re-recorded in next release")]
199+
[Fact]
200200
[Trait(Category.AcceptanceType, Category.CheckIn)]
201201
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
202202
public void TestAzureVMRestoreWithMSI()

src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ItemTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function Test-AzureCrossZonalRestore
138138
$targetVNetName = "hiagaNZPVNet"
139139
$targetVNetRG = "hiagarg"
140140
$targetSubnetName = "custom"
141-
$recoveryPointId = "166059983345323" # latest vaultStandard recovery point
141+
$recoveryPointId = "174747612387318" # latest vaultStandard recovery point
142142

143143
try
144144
{

0 commit comments

Comments
 (0)