Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Synapse/Synapse.Test/ScenarioTests/SqlPoolBackupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ public void TestSqlPoolRestorePoint(){
"Test-SqlPoolRestorePoint");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSqlPoolGeoBackup()
{
NewInstance.RunPsTest(
_logger,
"Test-SqlPoolGeoBackup");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDroppedSqlPool()
{
NewInstance.RunPsTest(
_logger,
"Test-DroppedSqlPool");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestRestoreFromRestorePoint()
Expand Down
68 changes: 67 additions & 1 deletion src/Synapse/Synapse.Test/ScenarioTests/SqlPoolBackupTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,72 @@ function Test-SqlPoolRestorePoint
}
}

function Test-SqlPoolGeoBackup
{
# Setup
$testSuffix = 'ps2502'
Comment thread
zesluo marked this conversation as resolved.
$params = Get-SqlPoolBackupTestEnvironmentParameters $testSuffix

try
{
$SqlPoolGeoBackupGet =Get-AzSynapseSqlPoolGeoBackup -ResourceGroupName $params.rgname -WorkspaceName $params.workspaceName
Assert-AreEqual $params.sqlPoolName $SqlPoolGeoBackupGet[0].Name
Assert-Null $SqlPoolGeoBackupGet[0].ElasticPoolName
Assert-NotNull $SqlPoolGeoBackupGet[0].Edition
Assert-NotNull $SqlPoolGeoBackupGet[0].LastAvailableBackupDate

$SqlPoolGeoBackupGetByPool =Get-AzSynapseSqlPoolGeoBackup -ResourceGroupName $params.rgname -WorkspaceName $params.workspaceName -Name $params.sqlPoolName
Assert-AreEqual $params.sqlPoolName $SqlPoolGeoBackupGetByPool.Name
Assert-Null $SqlPoolGeoBackupGetByPool.ElasticPoolName
Assert-NotNull $SqlPoolGeoBackupGetByPool.Edition
Assert-NotNull $SqlPoolGeoBackupGetByPool.LastAvailableBackupDate
}
finally
{
# Cleanup
Remove-SqlPoolBackupTestEnvironment $testSuffix
}
}

function Test-DroppedSqlPool
{
# Setup
$testSuffix = getAssetName
Create-SqlPoolBackupTestEnvironment $testSuffix
$params = Get-SqlPoolBackupTestEnvironmentParameters $testSuffix

try
{
Remove-AzSynapseSqlPool -ResourceGroupName $params.rgname -WorkspaceName $params.workspaceName -Name $params.sqlPoolName -Force

Wait-Seconds 300
Comment thread
zesluo marked this conversation as resolved.

Comment thread
zesluo marked this conversation as resolved.
$DroppedSqlPoolGet =Get-AzSynapseDroppedSqlPool -ResourceGroupName $params.rgname -WorkspaceName $params.workspaceName
Assert-AreEqual $params.sqlPoolName $DroppedSqlPoolGet[0].DatabaseName
Assert-Null $DroppedSqlPoolGet[0].ElasticPoolName
Assert-NotNull $DroppedSqlPoolGet[0].Edition
Assert-NotNull $DroppedSqlPoolGet[0].MaxSizeBytes
Assert-NotNull $DroppedSqlPoolGet[0].ServiceLevelObjective
Assert-NotNull $DroppedSqlPoolGet[0].CreationDate
Assert-NotNull $DroppedSqlPoolGet[0].DeletionDate
Assert-NotNull $DroppedSqlPoolGet[0].EarliestRestoreDate

$DroppedSqlPoolGetByPool= Get-AzSynapseDroppedSqlPool -ResourceGroupName $params.rgname -WorkspaceName $params.workspaceName -Name $params.sqlPoolName
Assert-AreEqual $params.sqlPoolName $DroppedSqlPoolGetByPool[0].DatabaseName
Assert-Null $DroppedSqlPoolGetByPool[0].ElasticPoolName
Assert-NotNull $DroppedSqlPoolGetByPool[0].Edition
Assert-NotNull $DroppedSqlPoolGetByPool[0].MaxSizeBytes
Assert-NotNull $DroppedSqlPoolGetByPool[0].ServiceLevelObjective
Assert-NotNull $DroppedSqlPoolGetByPool[0].CreationDate
Assert-NotNull $DroppedSqlPoolGetByPool[0].DeletionDate
Assert-NotNull $DroppedSqlPoolGetByPool[0].EarliestRestoreDate
}
finally
{
# Cleanup
Remove-SqlPoolBackupTestEnvironment $testSuffix
}
}
<#
.SYNOPSIS
Tests for restoring from restore point
Expand Down Expand Up @@ -203,7 +269,7 @@ function Get-SqlPoolBackupTestEnvironmentParameters ($testSuffix)
loginName = "testlogin";
pwd = "testp@ssMakingIt1007Longer";
perfLevel = 'DW200c';
location = "westcentralus";
location = "northeurope";
restoredSqlPoolName = "dwrestore" + $testSuffix;
}
}
Expand Down
Loading