Skip to content

Commit 92b5a66

Browse files
committed
Audit tests to create storage via templates
1 parent 1588e5b commit 92b5a66

File tree

34 files changed

+43233
-17712
lines changed

34 files changed

+43233
-17712
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,13 @@
529529
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.LocationCapabilitiesTests\TestLocationCapabilities.json">
530530
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
531531
</None>
532-
<None Include="Templates\sql-ddm-test-env-setup.json">
532+
<None Include="Templates\sql-audit-test-env-setup-storageV2.json">
533+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
534+
</None>
535+
<None Include="Templates\sql-audit-test-env-setup-classic-storage.json">
533536
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
534537
</None>
535-
<None Include="Templates\sql-audit-test-env-setup.json">
538+
<None Include="Templates\sql-ddm-test-env-setup.json">
536539
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
537540
</None>
538541
</ItemGroup>

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected override void SetupManagementClients()
4343
helper.SetupSomeOfManagementClients(sqlCSMClient, storageClient, storageV2Client, resourcesClient, authorizationClient);
4444
}
4545

46-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
46+
[Fact]
4747
[Trait(Category.AcceptanceType, Category.Sql)]
4848
public void TestAuditingDatabaseUpdatePolicyWithStorage()
4949
{
@@ -57,168 +57,168 @@ public void TestAuditingDatabaseUpdatePolicyWithStorageV2()
5757
RunPowerShellTest("Test-AuditingDatabaseUpdatePolicyWithStorageV2");
5858
}
5959

60-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
60+
[Fact]
6161
[Trait(Category.AcceptanceType, Category.Sql)]
6262
public void TestAuditingServerUpdatePolicyWithStorage()
6363
{
6464
RunPowerShellTest("Test-AuditingServerUpdatePolicyWithStorage");
6565
}
6666

67-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
67+
[Fact]
6868
[Trait(Category.AcceptanceType, Category.Sql)]
6969
public void TestAuditingDatabaseUpdatePolicyWithEventTypes()
7070
{
7171
RunPowerShellTest("Test-AuditingDatabaseUpdatePolicyWithEventTypes");
7272
}
7373

74-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
74+
[Fact]
7575
[Trait(Category.AcceptanceType, Category.Sql)]
7676
public void TestAuditingServerUpdatePolicyWithEventTypes()
7777
{
7878
RunPowerShellTest("Test-AuditingServerUpdatePolicyWithEventTypes");
7979
}
8080

81-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
81+
[Fact]
8282
[Trait(Category.AcceptanceType, Category.Sql)]
8383
public void TestAuditingDisableDatabaseAuditing()
8484
{
8585
RunPowerShellTest("Test-AuditingDisableDatabaseAuditing");
8686
}
8787

88-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
88+
[Fact]
8989
[Trait(Category.AcceptanceType, Category.Sql)]
9090
public void TestAuditingDisableServerAuditing()
9191
{
9292
RunPowerShellTest("Test-AuditingDisableServerAuditing");
9393
}
9494

95-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
95+
[Fact]
9696
[Trait(Category.AcceptanceType, Category.Sql)]
9797
public void TestAuditingDatabaseDisableEnableKeepProperties()
9898
{
9999
RunPowerShellTest("Test-AuditingDatabaseDisableEnableKeepProperties");
100100
}
101101

102-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
102+
[Fact]
103103
[Trait(Category.AcceptanceType, Category.Sql)]
104104
public void TestAuditingServerDisableEnableKeepProperties()
105105
{
106106
RunPowerShellTest("Test-AuditingServerDisableEnableKeepProperties");
107107
}
108108

109-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
109+
[Fact]
110110
[Trait(Category.AcceptanceType, Category.Sql)]
111111
public void TestAuditingUseServerDefault()
112112
{
113113
RunPowerShellTest("Test-AuditingUseServerDefault");
114114
}
115115

116-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
116+
[Fact]
117117
[Trait(Category.AcceptanceType, Category.Sql)]
118118
public void TestAuditingFailedDatabaseUpdatePolicyWithNoStorage()
119119
{
120120
RunPowerShellTest("Test-AuditingFailedDatabaseUpdatePolicyWithNoStorage");
121121
}
122122

123-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
123+
[Fact]
124124
[Trait(Category.AcceptanceType, Category.Sql)]
125125
public void TestAuditingFailedServerUpdatePolicyWithNoStorage()
126126
{
127127
RunPowerShellTest("Test-AuditingFailedServerUpdatePolicyWithNoStorage");
128128
}
129129

130-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
130+
[Fact]
131131
[Trait(Category.AcceptanceType, Category.Sql)]
132132
public void TestAuditingFailedUseServerDefault()
133133
{
134134
RunPowerShellTest("Test-AuditingFailedUseServerDefault");
135135
}
136136

137-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
137+
[Fact]
138138
[Trait(Category.AcceptanceType, Category.Sql)]
139139
public void TestAuditingDatabaseUpdatePolicyWithEventTypeShortcuts()
140140
{
141141
RunPowerShellTest("Test-AuditingDatabaseUpdatePolicyWithEventTypeShortcuts");
142142
}
143143

144-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
144+
[Fact]
145145
[Trait(Category.AcceptanceType, Category.Sql)]
146146
public void TestAuditingServerUpdatePolicyWithEventTypeShortcuts()
147147
{
148148
RunPowerShellTest("Test-AuditingServerUpdatePolicyWithEventTypeShortcuts");
149149
}
150150

151-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
151+
[Fact]
152152
[Trait(Category.AcceptanceType, Category.Sql)]
153153
public void TestAuditingDatabaseUpdatePolicyKeepPreviousStorage()
154154
{
155155
RunPowerShellTest("Test-AuditingDatabaseUpdatePolicyKeepPreviousStorage");
156156
}
157157

158-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
158+
[Fact]
159159
[Trait(Category.AcceptanceType, Category.Sql)]
160160
public void TestAuditingServerUpdatePolicyKeepPreviousStorage()
161161
{
162162
RunPowerShellTest("Test-AuditingServerUpdatePolicyKeepPreviousStorage");
163163
}
164164

165-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
165+
[Fact]
166166
[Trait(Category.AcceptanceType, Category.Sql)]
167167
public void TestAuditingFailWithBadDatabaseIndentity()
168168
{
169169
RunPowerShellTest("Test-AuditingFailWithBadDatabaseIndentity");
170170
}
171171

172-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
172+
[Fact]
173173
[Trait(Category.AcceptanceType, Category.Sql)]
174174
public void TestAuditingFailWithBadServerIndentity()
175175
{
176176
RunPowerShellTest("Test-AuditingFailWithBadServerIndentity");
177177
}
178178

179-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
179+
[Fact]
180180
[Trait(Category.AcceptanceType, Category.Sql)]
181181
public void TestAuditingDatabaseStorageKeyRotation()
182182
{
183183
RunPowerShellTest("Test-AuditingDatabaseStorageKeyRotation");
184184
}
185185

186-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
186+
[Fact]
187187
[Trait(Category.AcceptanceType, Category.Sql)]
188188
public void TestAuditingServerStorageKeyRotation()
189189
{
190190
RunPowerShellTest("Test-AuditingServerStorageKeyRotation");
191191
}
192192

193-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
193+
[Fact]
194194
[Trait(Category.AcceptanceType, Category.Sql)]
195195
public void TestAuditingServerUpdatePolicyWithRetention()
196196
{
197197
RunPowerShellTest("Test-AuditingServerUpdatePolicyWithRetention");
198198
}
199199

200-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
200+
[Fact]
201201
[Trait(Category.AcceptanceType, Category.Sql)]
202202
public void TestAuditingDatabaseUpdatePolicyWithRetention()
203203
{
204204
RunPowerShellTest("Test-AuditingDatabaseUpdatePolicyWithRetention");
205205
}
206206

207-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
207+
[Fact]
208208
[Trait(Category.AcceptanceType, Category.Sql)]
209209
public void TestAuditingServerRetentionKeepProperties()
210210
{
211211
RunPowerShellTest("Test-AuditingServerRetentionKeepProperties");
212212
}
213213

214-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
214+
[Fact]
215215
[Trait(Category.AcceptanceType, Category.Sql)]
216216
public void TestAuditingDatabaseRetentionKeepProperties()
217217
{
218218
RunPowerShellTest("Test-AuditingDatabaseRetentionKeepProperties");
219219
}
220220

221-
[Fact(Skip = "PSGet: TODO fix by moving SM specific logic to test setup")]
221+
[Fact]
222222
[Trait(Category.AcceptanceType, Category.Sql)]
223223
public void TestAuditingDatabaseUpdatePolicyWithSameNameStorageOnDifferentRegion()
224224
{

0 commit comments

Comments
 (0)