Make test robust

This commit is contained in:
lawrencegripper
2025-05-23 17:08:28 +01:00
parent a1cf69345e
commit 6fcdd215dc

View File

@@ -10,11 +10,11 @@ Describe "Disk free space" -Skip:(-not [String]::IsNullOrEmpty($env:AGENT_NAME)
Describe "fwupd removed" {
It "Is not present on box" {
$systemctlOutput = & systemctl list-unit-files fwupd-refresh.timer
if ($systemctlOutput -eq $null) {
# Service not installed, test passes
return
} else {
$systemctlOutput | Should -Match "masked"
}
# When enabled the output looks like this:
# systemctl list-unit-files fwupd-refresh.timer
#UNIT FILE STATE VENDOR PRESET
#fwupd-refresh.timer enabled enabled
#1 unit files listed.
$systemctlOutput | Should -Not -Match "enabled"
}
}