]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add a few more quick sanity checks to TEST-88-UPGRADE
authorLuca Boccassi <luca.boccassi@gmail.com>
Sun, 26 Jul 2026 11:33:15 +0000 (12:33 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 26 Jul 2026 12:45:28 +0000 (13:45 +0100)
test/units/TEST-88-UPGRADE.sh

index 153fc0ba49201412a24365b69303deabc97ee0b2..513eacab147626f93008435ec62bdb9a166b028d 100755 (executable)
@@ -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}')