From 803cac2271f6c033f37ac2b76e88dce78354a110 Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Wed, 26 Aug 2026 17:27:31 +0200 Subject: [PATCH] support/testing: TestFirewalld{Systemd, SysVInit}: fix expected ouput Since Firewalld v2.4.3 [1] firewall-cmd added a new log line while waiting for dbus connection [2]. [BRTEST# firewall-cmd --state Waiting on dbus connection... running The line "Waiting on dbus connection..." is not always printed by firewall-cmd, so we have to search explicitely for the expected string to get a reproducible test result. Update both TestFirewalld accordingly. This change is required to fix: https://gitlab.com/buildroot.org/buildroot/-/jobs/16060152329 (TestFirewalldSysVInit) https://gitlab.com/buildroot.org/buildroot/-/jobs/16060152332 (TestFirewalldSystemd) [1] 380dd8a348dc7c5edf2b187245b8d4e70a3d96c2 [2] https://github.com/firewalld/firewalld/commit/5e1c37c9664f57d81236ba999f13e60bf753ba45 Signed-off-by: Romain Naour Signed-off-by: Julien Olivain --- support/testing/tests/package/test_firewalld.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_firewalld.py b/support/testing/tests/package/test_firewalld.py index 9a1bd41f62..49a553947a 100644 --- a/support/testing/tests/package/test_firewalld.py +++ b/support/testing/tests/package/test_firewalld.py @@ -59,7 +59,10 @@ class TestFirewalldSystemd(infra.basetest.BRTest): cmd = "firewall-cmd --state" output, exit_code = self.emulator.run(cmd, timeout=10) - self.assertIn("running", output[0]) + # Ignore any unexpected log from firewall-cmd + # like "Waiting on dbus connection..." + expected_line = next(ln for ln in output if ln.strip().startswith('running')) + self.assertIn("running", expected_line) self.assertEqual(exit_code, 0) @@ -104,5 +107,8 @@ class TestFirewalldSysVInit(infra.basetest.BRTest): self.emulator.login(timeout=120) cmd = "firewall-cmd --state" output, exit_code = self.emulator.run(cmd, timeout=10) - self.assertIn("running", output[0]) + # Ignore any unexpected log from firewall-cmd + # like "Waiting on dbus connection..." + expected_line = next(ln for ln in output if ln.strip().startswith('running')) + self.assertIn("running", expected_line) self.assertEqual(exit_code, 0)