Skip to content

Commit

Permalink
DefaultBackupCompression checks added and tested #882
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed Apr 27, 2022
1 parent d8b71b9 commit ba748b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Perf Testing pesterv5.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ipmo ./dbachecks.psd1

#

$Checks = 'SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
$Checks = 'SaExist'
$Checks = 'DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
$Checks = 'DefaultBackupCompression'
Compare-CheckRuns -Checks $checks

<#
Expand Down
4 changes: 2 additions & 2 deletions Validate v4 adn v5.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ ipmo ./dbachecks.psd1

#

$Checks = 'SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
$Checks = 'SaExist'
$Checks = 'DefaultBackupCompression','SaExist','SaDisabled','SaRenamed','DefaultFilePath','AdHocDistributedQueriesEnabled','AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation'
$Checks = 'DefaultBackupCompression'
Compare-v4andv5Results -Checks $Checks

<#
Expand Down
9 changes: 9 additions & 0 deletions checks/Instancev5.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,12 @@ Describe "Login SA cannot exist" -Tag SaExist, CIS, Medium, Instance -ForEach $I
}
}
}

Describe "Default Backup Compression" -Tag DefaultBackupCompression, Low, Instance -ForEach $InstancesToTest {
$skip = Get-DbcConfigValue skip.instance.DefaultBackupCompression
Context "Checking Default Backup Compression on <_.Name>" {
It "Default Backup Compression is set to <_.ConfigValues.DefaultBackupCompression> on <_.Name>" -Skip:$skip {
$PSItem.Configuration.DefaultBackupCompression.ConfigValue -eq 1 | Should -Be $psitem.ConfigValues.DefaultBackupCompression -Because 'This is the setting you have chosen the default backup compression'
}
}
}
6 changes: 5 additions & 1 deletion internal/functions/NewGet-AllInstanceInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ function NewGet-AllInstanceInfo {
}
'AdHocDistributedQueriesEnabled' {
$configurations = $true
$ConfigValues | Add-Member -MemberType NoteProperty -Name 'AdHocDistributedQueriesEnabled' -Value (Get-DbcConfigValue policy.security.AdHocDistributedQueriesEnabled)
$ConfigValues | Add-Member -MemberType NoteProperty -Name 'AdHocDistributedQueriesEnabled' -Value (Get-DbcConfigValue policy.security.AdHocDistributedQueriesEnabled)
}
'DefaultBackupCompression' {
$configurations = $true
$ConfigValues | Add-Member -MemberType NoteProperty -Name 'DefaultBackupCompression' -Value (Get-DbcConfigValue policy.backup.defaultbackupcompression)
}
'DefaultFilePath' {
$SettingsInitFields.Add("DefaultFile") | Out-Null # so we can check file paths
Expand Down

0 comments on commit ba748b4

Please sign in to comment.