]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: make udevd also generate debugging logs
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Nov 2021 23:32:45 +0000 (08:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Nov 2021 23:32:45 +0000 (08:32 +0900)
test/test-network/conf/00-debug-net.rules [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/00-debug-net.rules b/test/test-network/conf/00-debug-net.rules
new file mode 100644 (file)
index 0000000..5146b90
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+SUBSYSTEM=="net", OPTIONS="log_level=debug"
index 58ca5b54461cbeb0eef8d8d885cb491708710ade..68b2e42502f16575df29d59bfbc86433e75d436b 100755 (executable)
@@ -23,6 +23,8 @@ networkd_ci_path='/run/networkd-ci'
 network_sysctl_ipv6_path='/proc/sys/net/ipv6/conf'
 network_sysctl_ipv4_path='/proc/sys/net/ipv4/conf'
 
+udev_rules_dir='/run/udev/rules.d'
+
 dnsmasq_pid_file='/run/networkd-ci/test-dnsmasq.pid'
 dnsmasq_log_file='/run/networkd-ci/test-dnsmasq.log'
 dnsmasq_lease_file='/run/networkd-ci/test-dnsmasq.lease'
@@ -273,10 +275,13 @@ def setUpModule():
     os.makedirs(network_unit_file_path, exist_ok=True)
     os.makedirs(networkd_conf_dropin_path, exist_ok=True)
     os.makedirs(networkd_ci_path, exist_ok=True)
+    os.makedirs(udev_rules_dir, exist_ok=True)
 
     shutil.rmtree(networkd_ci_path)
     copytree(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf'), networkd_ci_path)
 
+    shutil.copy(os.path.join(networkd_ci_path, '00-debug-net.rules'), udev_rules_dir)
+
     for u in ['systemd-networkd.socket', 'systemd-networkd.service', 'systemd-resolved.service',
               'systemd-udevd-kernel.socket', 'systemd-udevd-control.socket', 'systemd-udevd.service',
               'firewalld.service']:
@@ -372,6 +377,7 @@ def tearDownModule():
     global running_units
 
     shutil.rmtree(networkd_ci_path)
+    os.remove(os.path.join(udev_rules_dir, '00-debug-net.rules'))
 
     for u in ['systemd-networkd.socket', 'systemd-networkd.service', 'systemd-resolved.service']:
         check_output(f'systemctl stop {u}')