From adbd8e911af990117744c46744ece0ac9a1d7b3d Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Thu, 4 Mar 2021 18:13:01 -0800 Subject: [PATCH] include the failed command in the error output... addresses issue #5 --- bitelab/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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):