From: Luca Boccassi Date: Sat, 29 Mar 2025 17:56:04 +0000 (+0000) Subject: test: skip networkd tests if networkd/resolved are disabled at build time X-Git-Tag: v256.13~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37ada4a1f5cfd1ca191e228a0ece01a2035126d4;p=thirdparty%2Fsystemd.git test: skip networkd tests if networkd/resolved are disabled at build time (cherry picked from commit da2498352635921621a636014fee0547c53058b2) (cherry picked from commit 88a0d3dfcb7f5769ac1b1add3d66d9699252dfe0) --- diff --git a/test/networkd-test.py b/test/networkd-test.py index 47a3ad79632..2a98aece09d 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -47,6 +47,12 @@ def setUpModule(): global tmpmounts """Initialize the environment, and perform sanity checks on it.""" + + if shutil.which('networkctl') is None: + raise unittest.SkipTest('networkd not installed') + if shutil.which('resolvectl') is None: + raise unittest.SkipTest('resolved not installed') + if NETWORKD_WAIT_ONLINE is None: raise OSError(errno.ENOENT, 'systemd-networkd-wait-online not found') diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index ee7f6ccd0aa..febdfcb436e 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -7936,6 +7936,10 @@ if __name__ == '__main__': else: source_dir = None + if networkd_bin is None or resolved_bin is None or timesyncd_bin is None: + print("networkd tests require networkd/resolved/timesyncd to be enabled") + sys.exit(77) + use_valgrind = ns.use_valgrind enable_debug = ns.enable_debug asan_options = ns.asan_options