mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 08:14:09 -09:00
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]380dd8a348[2]5e1c37c966Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
committed by
Julien Olivain
parent
3bd3d5004d
commit
803cac2271
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user