Skip to content

Commit b18426a

Browse files
author
yaakoviyun
committed
Updated tests + test records
1 parent c560330 commit b18426a

File tree

8 files changed

+1566
-4916
lines changed

8 files changed

+1566
-4916
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,21 +215,5 @@ public void TestDatabaseRetentionKeepProperties()
215215
{
216216
RunPowerShellTest("Test-DatabaseRetentionKeepProperties");
217217
}
218-
219-
[Fact]
220-
[Trait(Category.RunType, Category.LiveOnly)]
221-
[Trait(Category.AcceptanceType, Category.CheckIn)]
222-
public void TestServerRetentionMissing()
223-
{
224-
RunPowerShellTest("Test-ServerRetentionMissing");
225-
}
226-
227-
[Fact]
228-
[Trait(Category.RunType, Category.LiveOnly)]
229-
[Trait(Category.AcceptanceType, Category.CheckIn)]
230-
public void TestDatabaseRetentionMissing()
231-
{
232-
RunPowerShellTest("Test-DatabaseRetentionMissing");
233-
}
234218
}
235219
}

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

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -871,70 +871,3 @@ function Test-DatabaseRetentionKeepProperties
871871
Remove-TestEnvironment $testSuffix
872872
}
873873
}
874-
875-
876-
<#
877-
.SYNOPSIS
878-
Tests the case when one of the retention values is missing from the server policy.
879-
#>
880-
function Test-ServerRetentionMissing
881-
{
882-
# Setup
883-
$testSuffix = 206
884-
Create-TestEnvironment $testSuffix
885-
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
886-
887-
try
888-
{
889-
# Test - only RetentionInDays
890-
Assert-Throws { Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -RetentionInDays 9 }
891-
892-
893-
# Test - only TableIdentifier
894-
$retentionTableIdentifier = "retentionTableIdentifier" + $testSuffix;
895-
Set-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -StorageAccountName $params.storageAccount -TableIdentifier $retentionTableIdentifier;
896-
$policy = Get-AzureSqlDatabaseServerAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName
897-
898-
# Assert
899-
Assert-AreEqual $policy.RetentionInDays 0
900-
Assert-AreEqual $policy.TableIdentifier $retentionTableIdentifier
901-
}
902-
finally
903-
{
904-
# Cleanup
905-
Remove-TestEnvironment $testSuffix
906-
}
907-
}
908-
909-
<#
910-
.SYNOPSIS
911-
Tests the case when one of the retention values is missing from the database policy.
912-
#>
913-
function Test-DatabaseRetentionMissing
914-
{
915-
# Setup
916-
$testSuffix = 207
917-
Create-TestEnvironment $testSuffix
918-
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
919-
920-
try
921-
{
922-
# Test - only RetentionInDays
923-
Assert-Throws { Set-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -StorageAccountName $params.storageAccount -RetentionInDays 9 }
924-
925-
926-
# Test - only TableIdentifier
927-
$retentionTableIdentifier = "retentionTableIdentifier" + $testSuffix;
928-
Set-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -StorageAccountName $params.storageAccount -TableIdentifier $retentionTableIdentifier;
929-
$policy = Get-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
930-
931-
# Assert
932-
Assert-AreEqual $policy.RetentionInDays 0
933-
Assert-AreEqual $policy.TableIdentifier $retentionTableIdentifier
934-
}
935-
finally
936-
{
937-
# Cleanup
938-
Remove-TestEnvironment $testSuffix
939-
}
940-
}

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestDatabaseRetentionKeepProperties.json

Lines changed: 257 additions & 298 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestDatabaseRetentionMissing.json

Lines changed: 0 additions & 1966 deletions
This file was deleted.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestDatabaseUpdatePolicyWithRetention.json

Lines changed: 331 additions & 283 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestServerRetentionKeepProperties.json

Lines changed: 548 additions & 219 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestServerRetentionMissing.json

Lines changed: 0 additions & 1870 deletions
This file was deleted.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests/TestServerUpdatePolicyWithRetention.json

Lines changed: 430 additions & 197 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)