From: Yu Watanabe Date: Wed, 8 Nov 2023 16:58:30 +0000 (+0900) Subject: networkd-test.py: hide default .network files X-Git-Tag: v255-rc2~15^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e978188cb2a568f834c0c32138ff9678fa9567b;p=thirdparty%2Fsystemd.git networkd-test.py: hide default .network files To make the test works fine with -Ddefault-network=True. --- diff --git a/test/networkd-test.py b/test/networkd-test.py index bf07bea17c8..9d8403d91d8 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -87,6 +87,12 @@ def setUpModule(): # Ensure the unit directory exists so tests can dump files into it. os.makedirs(NETWORK_UNITDIR, exist_ok=True) + # mask all default .network files + if os.path.exists('/usr/lib/systemd/network'): + for unit in os.listdir('/usr/lib/systemd/network'): + if unit.endswith('.network'): + os.symlink('/dev/null', os.path.join(NETWORK_UNITDIR, unit)) + def tearDownModule(): global tmpmounts