Browse Source

include the failed command in the error output...

addresses issue #5
main
John-Mark Gurney 3 years ago
parent
commit
adbd8e911a
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      bitelab/__init__.py

+ 3
- 2
bitelab/__init__.py View File

@@ -276,7 +276,7 @@ class EtherIface(DefROAttribute):
ret = await sub.wait() ret = await sub.wait()


if ret: if ret:
raise RuntimeError('activate failed: %d' % ret)
raise RuntimeError('exit code: %d, cmd: %s' % (ret, repr(cmd)))


class SerialConsole(DefROAttribute): class SerialConsole(DefROAttribute):
'''Specify a device to add to the board jail. This is primarily '''Specify a device to add to the board jail. This is primarily
@@ -1923,7 +1923,8 @@ class TestAttrs(unittest.IsolatedAsyncioTestCase):
stderr=subprocess.DEVNULL) stderr=subprocess.DEVNULL)


wrap_subprocess_exec(cse, retcode=1) 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) await ei.activate(brd)


async def test_multipleattrs(self): async def test_multipleattrs(self):


Loading…
Cancel
Save