Skip to content

Commit c28e2cc

Browse files
committed
Merge pull request Azure#696 from yoavrubin/dev
Bug fix: storage properties update
2 parents 953c4ab + 9f46852 commit c28e2cc

File tree

40 files changed

+21297
-18134
lines changed

40 files changed

+21297
-18134
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ function Get-SqlDataMaskingTestEnvironmentParameters ($testSuffix)
3838
pwd = "testp@ssMakingIt1007Longer";
3939
table1="table1";
4040
column1 = "column1";
41+
columnInt = "columnInt";
4142
table2="table2";
42-
column2 = "column2"
43+
column2 = "column2";
44+
columnFloat = "columnFloat"
4345
}
4446
}
4547

@@ -94,16 +96,17 @@ function Create-DataMaskingTestEnvironment ($testSuffix)
9496
$connection.Open()
9597
$table1 = $params.table1
9698
$column1 = $params.column1
97-
$query = "CREATE TABLE $table1 ($column1 NVARCHAR(20)NOT NULL);"
98-
$command = $connection.CreateCommand()
99-
$command.CommandText = $query
100-
$command.ExecuteReader()
99+
$columnInt = $params.columnInt
100+
101101
$table2 = $params.table2
102102
$column2 = $params.column2
103-
$query = "CREATE TABLE $table2 ($column2 NVARCHAR(20)NOT NULL);"
103+
$columnFloat = $params.columnFloat
104+
105+
$query = "CREATE TABLE $table1 ($column1 NVARCHAR(20)NOT NULL, $columnInt INT);CREATE TABLE $table2 ($column2 NVARCHAR(20)NOT NULL, $columnFloat DECIMAL(6,3));"
104106
$command = $connection.CreateCommand()
105107
$command.CommandText = $query
106108
$command.ExecuteReader()
109+
107110
}
108111
catch
109112
{

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,12 @@ public void TestDatabaseDataMaskingRuleCreationFailures()
6161
{
6262
RunPowerShellTest("Test-DatabaseDataMaskingRuleCreationFailures");
6363
}
64+
65+
[Fact]
66+
[Trait(Category.RunType, Category.LiveOnly)]
67+
public void TestDatabaseDataMaskingRuleCreationWithoutPolicy()
68+
{
69+
RunPowerShellTest("Test-DatabaseDataMaskingRuleCreationWithoutPolicy");
70+
}
6471
}
6572
}

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

Lines changed: 74 additions & 27 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ function Test-DatabaseUpdatePolicyWithEventTypes
191191

192192
# Assert
193193
Assert-AreEqual $policy.EventType.Length 3
194-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::PlainSQL_Success)}
195-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::ParameterizedSQL_Success)}
196-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::ParameterizedSQL_Failure)}
194+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::PlainSQL_Success)}
195+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Success)}
196+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Failure)}
197197

198198
# Test
199199
Set-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -StorageAccountName $params.storageAccount -EventType "None"
@@ -235,9 +235,9 @@ function Test-ServerUpdatePolicyWithEventTypes
235235

236236
# Assert
237237
Assert-AreEqual $policy.EventType.Length 3
238-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::PlainSQL_Success)}
239-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::ParameterizedSQL_Success)}
240-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::ParameterizedSQL_Failure)}
238+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::PlainSQL_Success)}
239+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Success)}
240+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::ParameterizedSQL_Failure)}
241241

242242

243243
# Test
@@ -451,7 +451,7 @@ function Test-DatabaseDisableEnableKeepProperties
451451
Assert-AreEqual $policy.AuditState "Enabled"
452452
Assert-AreEqual $policy.UseServerDefault "Disabled"
453453
Assert-AreEqual $policy.EventType.Length 1
454-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::Login_Failure)}
454+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::Login_Failure)}
455455
}
456456
finally
457457
{
@@ -483,7 +483,7 @@ function Test-ServerDisableEnableKeepProperties
483483
Assert-AreEqual $policy.StorageAccountName $params.storageAccount
484484
Assert-AreEqual $policy.AuditState "Enabled"
485485
Assert-AreEqual $policy.EventType.Length 1
486-
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Security.Model.AuditEventType]::TransactionManagement_Success)}
486+
Assert-True {$policy.EventType.Contains([Microsoft.Azure.Commands.Sql.Auditing.Model.AuditEventType]::TransactionManagement_Success)}
487487
}
488488
finally
489489
{

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests/TestDatabaseDataMaskingBasicRuleLifecycle.json

Lines changed: 765 additions & 6609 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests/TestDatabaseDataMaskingNumberRuleLifecycle.json

Lines changed: 986 additions & 782 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests/TestDatabaseDataMaskingRuleCreationFailures.json

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

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests/TestDatabaseDataMaskingRuleCreationWithoutPolicy.json

Lines changed: 4709 additions & 0 deletions
Large diffs are not rendered by default.

src/ResourceManager/Sql/Commands.Sql.Test/SessionRecords/Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests/TestDatabaseDataMaskingTextRuleLifecycle.json

Lines changed: 868 additions & 568 deletions
Large diffs are not rendered by default.

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

Lines changed: 425 additions & 377 deletions
Large diffs are not rendered by default.

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

Lines changed: 622 additions & 369 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)