Skip to content

Commit 9ba5176

Browse files
author
shicwu
committed
Adding stretch session records
1 parent b6e83b2 commit 9ba5176

File tree

2 files changed

+16
-44
lines changed

2 files changed

+16
-44
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@
424424
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseActivationTests\TestDatabasePauseResumePiped.json">
425425
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
426426
</None>
427+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseBackupStretchTests\TestStretchDatabaseListRestorePoints.json">
428+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
429+
</None>
427430
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseBackupTests\TestListDatabaseRestorePoints.json">
428431
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
429432
</None>
@@ -436,6 +439,18 @@
436439
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseBackupTests\TestRestorePointInTimeBackup.json">
437440
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
438441
</None>
442+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudStretchTests\TestStretchDatabaseCreate.json">
443+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
444+
</None>
445+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudStretchTests\TestStretchDatabaseGet.json">
446+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
447+
</None>
448+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudStretchTests\TestStretchDatabaseRemove.json">
449+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
450+
</None>
451+
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudStretchTests\TestStretchDatabaseUpdate.json">
452+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
453+
</None>
439454
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseCrudTests\TestDatabaseCreate.json">
440455
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
441456
</None>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseBackupStretchTests.ps1

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -40,47 +40,4 @@ function Test-ListStretchDatabaseRestorePoints
4040
{
4141
Remove-ResourceGroupForTest $rg
4242
}
43-
}
44-
45-
###
46-
# Just leave the following test cases here for further use
47-
###
48-
49-
#function Test-RestoreGeoBackup
50-
#{
51-
# # Setup
52-
# $location = "Southeast Asia"
53-
# $serverVersion = "12.0"
54-
# $rg = Get-AzureRmResourceGroup -ResourceGroupName hchung-test2
55-
# $server = Get-AzureRmSqlServer -ServerName hchung-testsvr2 -ResourceGroupName $rg.ResourceGroupName
56-
# $db = Get-AzureRmSqlDatabase -ServerName $server.ServerName -DatabaseName hchung-testdb-geo2 -ResourceGroupName $rg.ResourceGroupName
57-
# $restoredDbName = "powershell_db_georestored"
58-
59-
# Get-AzureRmSqlDatabaseGeoBackup -ResourceGroupName $server.ResourceGroupName -ServerName $server.ServerName -DatabaseName $db.DatabaseName | Restore-AzureRmSqlDatabase -FromGeoBackup -TargetDatabaseName $restoredDbName
60-
#}
61-
62-
#function Test-RestoreDeletedDatabaseBackup
63-
#{
64-
# # Setup
65-
# $location = "Southeast Asia"
66-
# $serverVersion = "12.0"
67-
# $rg = Get-AzureRmResourceGroup -ResourceGroupName hchung-test2
68-
# $server = Get-AzureRmSqlServer -ServerName hchung-testsvr2 -ResourceGroupName $rg.ResourceGroupName
69-
# $droppedDbName = "powershell_db_georestored"
70-
# $restoredDbName = "powershell_db_deleted"
71-
72-
# Get-AzureRmSqlDeletedDatabaseBackup -ResourceGroupName $server.ResourceGroupName -ServerName $server.ServerName -DatabaseName $droppedDbName -DeletionDate "2016-02-23T00:21:22.847Z" | Restore-AzureRmSqlDatabase -FromDeletedDatabaseBackup -TargetDatabaseName $restoredDbName
73-
#}
74-
75-
#function Test-RestorePointInTimeBackup
76-
#{
77-
# # Setup
78-
# $location = "Southeast Asia"
79-
# $serverVersion = "12.0"
80-
# $rg = Get-AzureRmResourceGroup -ResourceGroupName hchung-test
81-
# $server = Get-AzureRmSqlServer -ServerName hchung-testsvr -ResourceGroupName $rg.ResourceGroupName
82-
# $db = Get-AzureRmSqlDatabase -ServerName $server.ServerName -DatabaseName hchung-testdb -ResourceGroupName $rg.ResourceGroupName
83-
# $restoredDbName = "powershell_db_restored"
84-
85-
# Get-AzureRmSqlDatabase -ResourceGroupName $rg.ResourceGroupName -ServerName $server.ServerName -DatabaseName $db.DatabaseName | Restore-AzureRmSqlDatabase -FromPointInTimeBackup -PointInTime "2016-02-20T00:06:00Z" -TargetDatabaseName $restoredDbName
86-
#}
43+
}

0 commit comments

Comments
 (0)