test: add a few more quick sanity checks to TEST-88-UPGRADE

This commit is contained in:
Luca Boccassi
2026-07-26 13:45:28 +01:00
parent 28e1f84d6a
commit 14b93b6409
+28 -1
View File
@@ -36,6 +36,7 @@ fi
minor=$(systemctl --version | awk '/^systemd/{print$2}')
networkd=
resolved=
unitscmd='systemctl list-units --failed *systemd*'
if [[ $($unitscmd --output json | jq length) -gt 0 ]]; then
@@ -46,6 +47,22 @@ fi
check_sd() {
local unit fail=0 timer1_new timer2_new
if ! systemctl daemon-reload; then
echo 'System manager reload failed after the test!'
fail=1
fi
if ! systemd-run --quiet --wait --collect --service-type=exec true; then
echo 'Transient service failed after the test!'
fail=1
fi
if command -v udevadm >/dev/null && ! udevadm control --ping --timeout=5; then
echo 'Udev failed after the test!'
fail=1
fi
for unit in $($unitscmd --output json | jq -r '.[].unit'); do
if ! grep -sxqF "$unit" /tmp/failed-units; then
fail=1
@@ -64,6 +81,13 @@ check_sd() {
fi
fi
if [[ -n $resolved ]]; then
if ! resolvectl status; then
echo 'Resolved failed after the test!'
fail=1
fi
fi
if ! loginctl list-sessions; then
echo 'Loginctl failed after the test!'
fail=1
@@ -103,10 +127,13 @@ systemctl stop systemd-networkd-resolve-hook.socket || true
"${downgrade[@]}" "$pkgdir"/distro/*."$package_extension"
# Some distros don't ship networkd, so the test will always fail
# Some distros don't ship networkd or resolved, so only test them when available
if command -v networkctl >/dev/null; then
networkd=1
fi
if command -v resolvectl >/dev/null && systemctl is-active --quiet systemd-resolved.service; then
resolved=1
fi
newminor=$(systemctl --version | awk '/^systemd/{print$2}')