@@ -219,13 +219,13 @@ Describe "Remove-UserAccounts" {
219219Describe " Invoke-Sysprep" {
220220 Context " when not provided an IaaS" {
221221 It " throws" {
222- { Invoke-Sysprep - OsVersion " windows2012R2 " } | Should - Throw " Provide the IaaS this stemcell will be used for"
222+ { Invoke-Sysprep - OsVersion " windows2019 " } | Should - Throw " Provide the IaaS this stemcell will be used for"
223223 }
224224 }
225225
226226 Context " when provided an invalid Iaas" {
227227 It " throws" {
228- { Invoke-Sysprep - IaaS " OpenShift" - SkipLGPO - OsVersion " windows2012R2 " } | Should - Throw " Invalid IaaS 'OpenShift' supported platforms are: AWS, Azure, GCP and Vsphere"
228+ { Invoke-Sysprep - IaaS " OpenShift" - SkipLGPO - OsVersion " windows2019 " } | Should - Throw " Invalid IaaS 'OpenShift' supported platforms are: AWS, Azure, GCP and Vsphere"
229229 }
230230 }
231231
@@ -258,32 +258,6 @@ Describe "Invoke-Sysprep" {
258258 }
259259
260260 Context " for AWS" {
261- It " handles Windows 1709" {
262- Mock Get-OSVersion { " windows2016" } - ModuleName BOSH.Sysprep
263-
264- { Invoke-Sysprep - Iaas " aws" } | Should -Not - Throw
265-
266- Assert-MockCalled Update-AWS2016Config - Times 1 - Scope It - ModuleName BOSH.Sysprep
267- Assert-MockCalled Enable-AWS2016Sysprep - Times 1 - Scope It - ModuleName BOSH.Sysprep
268-
269- Assert-MockCalled Get-OSVersion - Times 1 - Scope It - ModuleName BOSH.Sysprep
270-
271- Assert-MockCalled Start-Process - Times 0 - Scope It - ParameterFilter { $FilePath -eq " C:\Program Files\Amazon\Ec2ConfigService\Ec2Config.exe" -and $ArgumentList -eq " -sysprep" } - ModuleName BOSH.Sysprep
272- }
273-
274- It " handles Windows 1803" {
275- Mock Get-OSVersion { " windows1803" } - ModuleName Bosh.Sysprep
276-
277- { Invoke-Sysprep - Iaas " aws" } | Should -Not - Throw
278-
279- Assert-MockCalled Update-AWS2016Config - Times 1 - Scope It - ModuleName BOSH.Sysprep
280- Assert-MockCalled Enable-AWS2016Sysprep - Times 1 - Scope It - ModuleName BOSH.Sysprep
281-
282- Assert-MockCalled Get-OSVersion - Times 1 - Scope It - ModuleName BOSH.Sysprep
283-
284- Assert-MockCalled Start-Process - Times 0 - Scope It - ParameterFilter { $FilePath -eq " C:\Program Files\Amazon\Ec2ConfigService\Ec2Config.exe" -and $ArgumentList -eq " -sysprep" } - ModuleName BOSH.Sysprep
285- }
286-
287261 It " handles other OS'" {
288262 Mock Get-OSVersion { Throw " invalid OS detected" } - ModuleName Bosh.Sysprep
289263
@@ -342,30 +316,6 @@ Describe "Invoke-Sysprep" {
342316 Context " for LGPO" {
343317 # We use AWS as the IaaS as it is the only IaaS that is fully mocked right now
344318 # We don't want to trigger Sysprep during our test
345- It " handles Windows 2012R2" {
346- Mock Get-OSVersion { " windows2012R2" } - ModuleName Bosh.Sysprep
347- $ExpectedPath = Join-Path $PSScriptRoot " cis-merge-2012R2"
348- { Invoke-Sysprep - Iaas " aws" } | Should -Not - Throw
349-
350- Assert-MockCalled Enable-LocalSecurityPolicy - ParameterFilter { $PolicySource -eq $ExpectedPath } - Times 1 - Scope It - ModuleName BOSH.Sysprep
351- }
352-
353- It " handles Windows 1709" {
354- Mock Get-OSVersion { " windows2016" } - ModuleName Bosh.Sysprep
355-
356- { Invoke-Sysprep - Iaas " aws" } | Should -Not - Throw
357-
358- Assert-MockCalled Enable-LocalSecurityPolicy - Times 0 - Scope It - ModuleName BOSH.Sysprep
359- }
360-
361- It " handles Windows 1803" {
362- Mock Get-OSVersion { " windows1803" } - ModuleName Bosh.Sysprep
363- $ExpectedPath = Join-Path $PSScriptRoot " cis-merge-1803"
364- { Invoke-Sysprep - Iaas " aws" } | Should -Not - Throw
365-
366- Assert-MockCalled Enable-LocalSecurityPolicy - ParameterFilter { $PolicySource -eq $ExpectedPath } - Times 1 - Scope It - ModuleName BOSH.Sysprep
367- }
368-
369319 It " handles Windows 2019" {
370320 Mock Get-OSVersion { " windows2019" } - ModuleName Bosh.Sysprep
371321 $ExpectedPath = Join-Path $PSScriptRoot " cis-merge-2019"
@@ -375,7 +325,7 @@ Describe "Invoke-Sysprep" {
375325 }
376326
377327 It " skips local policy update if -SkipLGPO is set" {
378- Mock Get-OSVersion { " windows2012R2 " } - ModuleName Bosh.Sysprep
328+ Mock Get-OSVersion { " windows2019 " } - ModuleName Bosh.Sysprep
379329
380330 { Invoke-Sysprep - Iaas " aws" - SkipLGPO } | Should -Not - Throw
381331
0 commit comments