More robust aktualizr-ptest printing of errors
If ctest is interrupted (e.g. timeout), its partial output will be in
/tmp/aktualizr-ptest.log.tmp
@@ -41,12 +41,12 @@ class PtestTests(OESelftestTestCase):
stdout, stderr, retcode = self.qemu_command('sh -l -c ptest-runner', timeout=None)
output = stdout.decode()
print(output)
- self.assertEqual(retcode, 0)
has_failure = re.search('^FAIL', output, flags=re.MULTILINE) is not None
if has_failure:
print("Full test suite log:")
- stdout, stderr, retcode = self.qemu_command('cat /tmp/aktualizr-ptest.log', timeout=None)
+ stdout, _, _ = self.qemu_command('sh -c "cat /tmp/aktualizr-ptest.log || cat /tmp/aktualizr-ptest.log.tmp"', timeout=None)
print(stdout.decode())
+ self.assertEqual(retcode, 0)
self.assertFalse(has_failure)
