mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Add test to validate windows updates installation (#4489)
* Add test to validate windows updates installation * Add function Get-WindowsUpdatesHistory
This commit is contained in:
committed by
GitHub
parent
1b583e05e5
commit
df27520b1f
@@ -56,3 +56,25 @@ Describe "Test Signed Drivers" -Skip:(Test-IsWin16) {
|
||||
"$(bcdedit)" | Should -Match "testsigning\s+Yes"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Windows Updates" {
|
||||
It "WindowsUpdateDone.txt should exist" {
|
||||
"$env:windir\WindowsUpdateDone.txt" | Should -Exist
|
||||
}
|
||||
|
||||
$testCases = Get-WindowsUpdatesHistory | Sort-Object Title | ForEach-Object {
|
||||
@{
|
||||
Title = $_.Title
|
||||
Status = $_.Status
|
||||
}
|
||||
}
|
||||
|
||||
It "<Title>" -TestCases $testCases {
|
||||
$expect = "Successful"
|
||||
if ( $Title -match "Microsoft Defender Antivirus" ) {
|
||||
$expect = "Successful", "Failure"
|
||||
}
|
||||
|
||||
$Status | Should -BeIn $expect
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user