From: Zbigniew Jędrzejewski-Szmek Date: Fri, 13 Mar 2026 11:02:07 +0000 (+0100) Subject: test-network: handle the case where dnsmasq is slow to start better X-Git-Tag: v260-rc4~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e799263ff4160565953ac6b52be3706d91133bd0;p=thirdparty%2Fsystemd.git test-network: handle the case where dnsmasq is slow to start better > read_dnsmasq_log_file() will raise FileNotFoundError if dnsmasq hasn’t created the > log file yet (or if the file was just removed by stop_dnsmasq() before the restart). > This would error the test instead of retrying. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 8aee898aab3..bab725bd239 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -8023,7 +8023,10 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): success = False for _ in range(20): time.sleep(0.5) - output = read_dnsmasq_log_file() + try: + output = read_dnsmasq_log_file() + except FileNotFoundError: + output = "" if 'DHCPRELEASE' in output: success = True break