Bug: Mask fwupd timer on ubuntu images (#12225)

* Bug: Fully remove `fwupd` from ubuntu images

We're running on VMs in Azure and the fwupd package is not needed.

Leaving it enable means periodic refreshes show in network traffic and firewall logs.

* Update check method

* Simplify test
This commit is contained in:
Lawrence Gripper
2025-05-22 20:59:38 +01:00
committed by GitHub
parent ac5bfa5ec6
commit ff069dce92
2 changed files with 17 additions and 1 deletions

View File

@@ -59,9 +59,18 @@ ln -s $HELPER_SCRIPTS/invoke-tests.sh /usr/local/bin/invoke_tests
# Disable motd updates metadata
sed -i 's/ENABLED=1/ENABLED=0/g' /etc/default/motd-news
# Remove fwupd if installed. We're running on VMs in Azure and the fwupd package is not needed.
# Leaving it enable means periodic refreshes show in network traffic and firewall logs
# Check if fwupd-refresh.timer exists in systemd
if systemctl list-unit-files fwupd-refresh.timer &>/dev/null; then
echo "Masking fwupd-refresh.timer..."
systemctl mask fwupd-refresh.timer
fi
# This is a legacy check, leaving for earlier versions of Ubuntu
# If fwupd config still exists, disable the motd updates
if [[ -f "/etc/fwupd/daemon.conf" ]]; then
sed -i 's/UpdateMotd=true/UpdateMotd=false/g' /etc/fwupd/daemon.conf
systemctl mask fwupd-refresh.timer
fi
# Disable to load providers

View File

@@ -6,3 +6,10 @@ Describe "Disk free space" -Skip:(-not [String]::IsNullOrEmpty($env:AGENT_NAME)
$freeSpace | Should -BeGreaterOrEqual 17GB
}
}
Describe "fwupd removed" {
It "Is not present on box" {
$systemctlOutput = & systemctl list-unit-files fwupd-refresh.timer
$systemctlOutput | Should -Match "masked"
}
}