From: Benjamin Drung <benjamin.drung@canonical.com>
Date: Fri, 7 Feb 2025 19:35:35 +0100
Subject: test(FULL-SYSTEMD): skip systemd-network-management if missing

The Debian/Ubuntu package runs the FULL-SYSTEMD test without
dracut-network installed. Therefore the test fails due to the missing
`systemd-network-management` module:

```
TEST: Full systemd serialization/deserialization test with /usr mount
dracut[E]: Module 'systemd-network-management' cannot be found.
```

Fixes: 75f3a191b675 ("test(FULL-SYSTEMD): when systemd-networkd is available, install it")
Forwarded: https://github.com/dracut-ng/dracut-ng/pull/1203
---
 test/TEST-41-FULL-SYSTEMD/test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/TEST-41-FULL-SYSTEMD/test.sh b/test/TEST-41-FULL-SYSTEMD/test.sh
index aaf8cd7..20dfb89 100755
--- a/test/TEST-41-FULL-SYSTEMD/test.sh
+++ b/test/TEST-41-FULL-SYSTEMD/test.sh
@@ -72,7 +72,7 @@ test_setup() {
         dracut_modules="$dracut_modules dbus-daemon"
     fi
 
-    if [ -f /usr/lib/systemd/systemd-networkd ]; then
+    if [ -f /usr/lib/systemd/systemd-networkd ] && [ -e "${PKGLIBDIR}/modules.d/00systemd-network-management/module-setup.sh" ]; then
         dracut_modules="$dracut_modules systemd-network-management"
     fi
 
