python/tests/blackbox: check_exit_code() explains by default
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 24 Oct 2018 04:49:00 +0000 (17:49 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 8 Jan 2019 22:55:31 +0000 (23:55 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/__init__.py

index 2eaf978..e95b6a9 100644 (file)
@@ -413,6 +413,8 @@ class BlackboxTestCase(TestCaseInTempDir):
         stdoutdata, stderrdata = p.communicate()
         retcode = p.returncode
         if retcode != expected:
+            if msg is None:
+                msg = "expected return code %s; got %s" % (expected, retcode)
             raise BlackboxProcessError(retcode,
                                        line,
                                        stdoutdata,