The branch, master has been updated via dcd5a64ca74 selftest/subunithelper: also output as much of unterminated DETAILS via 3f556d9770a selftest/subunithelper: only let '] ' lines to terminate via b3ffc61e2fe SambaToolCmdTest: let assertCmdSuccess() escape '] ' lines via 40079975f71 testprogs/blackbox: make sure subunit.sh always terminates DETAILS with ' ] ' from 457b49c6780 s3: modules: gluster. Fix the error I made in preventing talloc leaks from a function.
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit dcd5a64ca742aadf922362a4254ed20c2bc5c64d Author: Stefan Metzmacher <me...@samba.org> Date: Fri Nov 6 12:35:04 2020 +0100 selftest/subunithelper: also output as much of unterminated DETAILS Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagn...@samba.org> Autobuild-Date(master): Wed Nov 11 22:43:46 UTC 2020 on sn-devel-184 commit 3f556d9770a052c6c650183d6ce352d4bc620e53 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 5 14:19:11 2020 +0100 selftest/subunithelper: only let ']\n' lines to terminate It should not be enough that a line ends with ']\n' is accident, subunit DETAILS are terminated with '\n]\n'! 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 <me...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit b3ffc61e2fe3011b8447af33fc4a1d095ed05884 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Nov 5 13:46:27 2020 +0100 SambaToolCmdTest: let assertCmdSuccess() escape ']\n' lines 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 <me...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> commit 40079975f71fc5031da87d4c803b794c2c67107a Author: Stefan Metzmacher <me...@samba.org> Date: Fri Nov 6 12:32:10 2020 +0100 testprogs/blackbox: make sure subunit.sh always terminates DETAILS with '\n]\n' Signed-off-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> ----------------------------------------------------------------------- Summary of changes: python/samba/tests/samba_tool/base.py | 7 +++++-- selftest/subunithelper.py | 6 +++--- testprogs/blackbox/subunit.sh | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/tests/samba_tool/base.py b/python/samba/tests/samba_tool/base.py index 00e742e7c5b..ff6f9fcc5d3 100644 --- a/python/samba/tests/samba_tool/base.py +++ b/python/samba/tests/samba_tool/base.py @@ -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) diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py index baab146ca60..26158cad339 100644 --- a/selftest/subunithelper.py +++ b/selftest/subunithelper.py @@ -85,8 +85,7 @@ def parse_results(msg_ops, statistics, fh): if l == "": break msg_ops.control_msg(l) - if l[-2:] == "]\n": - reason += l[:-2] + if l == "]\n": terminated = True break else: @@ -99,7 +98,8 @@ def parse_results(msg_ops, statistics, fh): if not terminated: statistics['TESTS_ERROR'] += 1 - msg_ops.addError(subunit.RemotedTestCase(testname), subunit.RemoteError(u"reason (%s) interrupted" % result)) + msg_ops.addError(subunit.RemotedTestCase(testname), + subunit.RemoteError(u"result (%s) reason (%s) interrupted" % (result, reason))) return 1 else: reason = None diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh index bcc5bd6a928..45183575bdd 100755 --- a/testprogs/blackbox/subunit.sh +++ b/testprogs/blackbox/subunit.sh @@ -50,7 +50,7 @@ subunit_fail_test () { timestamp printf 'failure: %s [\n' "$1" cat - - echo "]" + printf '\n]\n' } @@ -62,7 +62,7 @@ subunit_error_test () { timestamp printf 'error: %s [\n' "$1" cat - - echo "]" + printf '\n]\n' } subunit_skip_test () { @@ -72,7 +72,7 @@ subunit_skip_test () { # makes it convenient to write in scripts (using <<END syntax. printf 'skip: %s [\n' "$1" cat - - echo "]" + printf '\n]\n' } testit () { -- Samba Shared Repository