From 6fcdd215dcad754c26a403d88ee592c6f72fe3f8 Mon Sep 17 00:00:00 2001 From: lawrencegripper Date: Fri, 23 May 2025 17:08:28 +0100 Subject: [PATCH] Make test robust --- images/ubuntu/scripts/tests/System.Tests.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/images/ubuntu/scripts/tests/System.Tests.ps1 b/images/ubuntu/scripts/tests/System.Tests.ps1 index 1396613ae..96a176912 100644 --- a/images/ubuntu/scripts/tests/System.Tests.ps1 +++ b/images/ubuntu/scripts/tests/System.Tests.ps1 @@ -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" } }