diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py index 96c6848dfc..45bcd4c2e2 100644 --- a/support/testing/infra/basetest.py +++ b/support/testing/infra/basetest.py @@ -88,7 +88,12 @@ class BRTest(BRConfigTest): super(BRTest, self).tearDown() # Run the given 'cmd' with a 'timeout' on the target and - # assert that the command succeeded + # assert that the command succeeded; on error, print the + # faulty command and its output def assertRunOk(self, cmd, timeout=-1): - _, exit_code = self.emulator.run(cmd, timeout) - self.assertEqual(exit_code, 0) + out, exit_code = self.emulator.run(cmd, timeout) + self.assertEqual( + exit_code, + 0, + "\nFailed to run: {}\noutput was:\n{}".format(cmd, ' '+'\n '.join(out)) + )