Merge pull request #1229 from ruandersMSFT/patch-1
Fix Unit Testing for valid STIG files
This commit is contained in:
Коммит
cf8a428988
|
@ -15,11 +15,11 @@ Describe 'Backup-StigSettings' {
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should not throw WindowsClient' {
|
It 'Should not throw WindowsClient' {
|
||||||
{Backup-StigSettings -StigName "WindowsClient-10-2.2.xml"} | Should -not -Throw
|
{Backup-StigSettings -StigName "WindowsClient-10-2.5.xml"} | Should -not -Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should not throw Sql Server 2016' {
|
It 'Should not throw Sql Server 2016' {
|
||||||
{Backup-StigSettings -StigName "SqlServer-2016-Instance-2.3.xml"} | Should -not -Throw
|
{Backup-StigSettings -StigName "SqlServer-2016-Instance-2.8.xml"} | Should -not -Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should return string with valid STIGs' {
|
It 'Should return string with valid STIGs' {
|
||||||
|
@ -45,11 +45,11 @@ Describe 'Restore-StigSettings' {
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should not throw for Client' {
|
It 'Should not throw for Client' {
|
||||||
{Restore-StigSettings -StigName "WindowsClient-10-2.2.xml" -Confirm:$false} | Should -Not -Throw
|
{Restore-StigSettings -StigName "WindowsClient-10-2.5.xml" -Confirm:$false} | Should -Not -Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should not throw for Sql Server 2016' {
|
It 'Should not throw for Sql Server 2016' {
|
||||||
{Restore-StigSettings -StigName "SqlServer-2016-Instance-2.3.xml" -Confirm:$false} | Should -Not -Throw
|
{Restore-StigSettings -StigName "SqlServer-2016-Instance-2.8.xml" -Confirm:$false} | Should -Not -Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ function Backup-StigSettings
|
||||||
if ($validStigs.Name -notContains $StigName.Trim())
|
if ($validStigs.Name -notContains $StigName.Trim())
|
||||||
{
|
{
|
||||||
$errorArray = $validStigs.Name -join("`n")
|
$errorArray = $validStigs.Name -join("`n")
|
||||||
Write-Host "StigName not valid, options are :`n$errorArray"
|
Write-Host "StigName '$($StigName.Trim())' not valid, options are :`n$errorArray"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ function Restore-StigSettings
|
||||||
if ($validStigs.Name -notContains $StigName.Trim())
|
if ($validStigs.Name -notContains $StigName.Trim())
|
||||||
{
|
{
|
||||||
$errorArray = $validStigs.Name -join("`n")
|
$errorArray = $validStigs.Name -join("`n")
|
||||||
Write-Host "StigName not valid, options are :`n$errorArray"
|
Write-Host "StigName '$($StigName.Trim())' not valid, options are :`n$errorArray"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче