]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
SambaToolCmdTest: let assertCmdSuccess() escape ']\n' lines
authorStefan Metzmacher <metze@samba.org>
Thu, 5 Nov 2020 12:46:27 +0000 (13:46 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 11 Nov 2020 21:14:32 +0000 (21:14 +0000)
This gives a much higher chance to see the actual problem
without having them filtered by various 'filter-subunit' invocations.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/samba_tool/base.py

index 00e742e7c5bcc0c97a5609a288927e86d7cccbb8..ff6f9fcc5d3453950bbbab516c4a6be36ee1c1e1 100644 (file)
@@ -105,8 +105,11 @@ class SambaToolCmdTest(samba.tests.BlackboxTestCase):
         return (result, cmd.outf.getvalue(), cmd.errf.getvalue())
 
     def assertCmdSuccess(self, exit, out, err, msg=""):
-        self.assertIsNone(exit, msg="exit[%s] stdout[%s] stderr[%s]: %s" % (
-                          exit, out, err, msg))
+        # Make sure we allow '\n]\n' in stdout and stderr
+        # without causing problems with the subunit protocol.
+        # We just inject a space...
+        msg = "exit[%s] stdout[%s] stderr[%s]: %s" % (exit, out, err, msg)
+        self.assertIsNone(exit, msg=msg.replace("\n]\n", "\n] \n"))
 
     def assertCmdFail(self, val, msg=""):
         self.assertIsNotNone(val, msg)