From 2e978188cb2a568f834c0c32138ff9678fa9567b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 9 Nov 2023 01:58:30 +0900 Subject: [PATCH] networkd-test.py: hide default .network files To make the test works fine with -Ddefault-network=True. --- test/networkd-test.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.47.3