buildroot: return a new CompletedBuild with output

Create a new CompletedBuild object that wraps and is very similar
to the subprocess.CompletedProcess, i.e. it has a process member
but also has shortcuts for returncode. Additionally, the output
of the process is not only forwarded to the monitor, but also
captured and then handed to CompletedBuild, so its output member
will actually contain the full build output. To be compatible
with the previously returned CompletedProcess, `stderr`, `stdout`
members exist on CompletedBuild that also return `output`.
This commit is contained in:
Christian Kellner 2020-08-28 15:39:12 +02:00
parent 61966e3f4c
commit 10579ee6f5
2 changed files with 37 additions and 1 deletions

View file

@ -68,6 +68,8 @@ class TestBuildRoot(test.TestBase):
with open(logfile) as f:
log = f.read()
assert log
assert r.output
self.assertEqual(log, r.output)
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
def test_bind_mounts(self):