diff --git a/bitelab/__init__.py b/bitelab/__init__.py index bda1a4b..6e15fb5 100644 --- a/bitelab/__init__.py +++ b/bitelab/__init__.py @@ -276,7 +276,7 @@ class EtherIface(DefROAttribute): ret = await sub.wait() if ret: - raise RuntimeError('activate failed: %d' % ret) + raise RuntimeError('exit code: %d, cmd: %s' % (ret, repr(cmd))) class SerialConsole(DefROAttribute): '''Specify a device to add to the board jail. This is primarily @@ -1923,7 +1923,8 @@ class TestAttrs(unittest.IsolatedAsyncioTestCase): stderr=subprocess.DEVNULL) wrap_subprocess_exec(cse, retcode=1) - with self.assertRaises(RuntimeError): + # make sure that the necessary info is in the exception + with self.assertRaisesRegex(RuntimeError, 'exit code: 1.*' + eiface + '.*' + 'foo'): await ei.activate(brd) async def test_multipleattrs(self):