From: David Mulder Date: Fri, 6 Jan 2023 21:49:19 +0000 (-0700) Subject: gp: Ensure Firewalld tests don't flop X-Git-Tag: tevent-0.16.0~1326 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=217beca6e9dc68db774e79ade59b4f7d4c3791b7;p=thirdparty%2Fsamba.git gp: Ensure Firewalld tests don't flop This test was failing depending on the system it was run on, since the result depends on whether firewalld python bindings were installed. This wasn't failing in CI (and so there is no flopping test marked), but does fail on some local systems. Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index f5e25e71041..eb1b53a7833 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -7125,9 +7125,13 @@ class GPOTests(tests.TestCase): cmd = [firewall_cmd, '--zone=work', '--list-rich-rules'] p = Popen(cmd, stdout=PIPE, stderr=PIPE) out, err = p.communicate() - rule = b'rule family=ipv4 source address=172.25.1.7 ' + \ - b'service name=ftp reject' - self.assertEquals(rule, out.strip(), 'Failed to set rich rule') + # Firewalld will report the rule one of two ways: + rules = [b'rule family=ipv4 source address=172.25.1.7 ' + \ + b'service name=ftp reject', + b'rule family="ipv4" source address="172.25.1.7" ' + \ + b'service name="ftp" reject'] + self.assertIn(out.strip(), rules, 'Failed to set rich rule') + # Verify RSOP does not fail ext.rsop([g for g in gpos if g.name == guid][0])