Files
runner-images/images/ubuntu/scripts/tests/System.Tests.ps1
T

22 lines
1.1 KiB
PowerShell
Raw Normal View History

# The $env:AGENT_NAME and $env:RUNNER_NAME are predefined variables for the ADO pipelines and for the GitHub actions respectively.
# If the test is running on the ADO pipeline or on the GitHub actions, the test will be skipped
Describe "Disk free space" -Skip:(-not [String]::IsNullOrEmpty($env:AGENT_NAME) -or -not [String]::IsNullOrEmpty($env:RUNNER_NAME)) {
It "Image has enough free space" {
2023-11-22 21:49:23 +01:00
$freeSpace = (Get-PSDrive "/").Free
$freeSpace | Should -BeGreaterOrEqual 17GB
2023-11-22 21:49:23 +01:00
}
}
Describe "fwupd removed" {
It "Is not present on box" {
2025-05-27 09:33:33 +01:00
$systemctlOutput = & systemctl list-unit fwupd-refresh.timer --no-legend
# When disabled the output looks like this:
# systemctl list-units fwupd-refresh.timer --no-legend
#● fwupd-refresh.timer masked failed failed fwupd-refresh.timer
2025-05-23 17:08:28 +01:00
# When enabled the output looks like this:
2025-05-27 09:33:33 +01:00
# systemctl list-units fwupd-refresh.timer --no-legend
#fwupd-refresh.timer loaded active waiting Refresh fwupd metadata regularly
$systemctlOutput | Should -Not -Match "active"
}
}