test/buildroot: check BuildRoot.output
Now that the `org.osbuild.linux` runner does not use `api.setup_stdio` anymore, the output of the binary run from the BuildRoot must end up in `BuildRoot.output`. Check for that.
This commit is contained in:
parent
499ae1654e
commit
a3934ab947
1 changed files with 18 additions and 0 deletions
|
|
@ -71,6 +71,24 @@ class TestBuildRoot(test.TestBase):
|
|||
assert r.output
|
||||
self.assertEqual(log, r.output)
|
||||
|
||||
def test_output(self):
|
||||
runner = "org.osbuild.linux"
|
||||
libdir = os.path.abspath(os.curdir)
|
||||
var = pathlib.Path(self.tmp.name, "var")
|
||||
var.mkdir()
|
||||
|
||||
data = "42. cats are superior to dogs"
|
||||
|
||||
monitor = NullMonitor(sys.stderr.fileno())
|
||||
with BuildRoot("/", runner, libdir=libdir, var=var) as root:
|
||||
api = osbuild.api.API({}, monitor)
|
||||
root.register_api(api)
|
||||
|
||||
r = root.run(["/usr/bin/echo", data], monitor)
|
||||
self.assertEqual(r.returncode, 0)
|
||||
|
||||
self.assertEqual(data, r.output.strip())
|
||||
|
||||
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
|
||||
def test_bind_mounts(self):
|
||||
runner = "org.osbuild.linux"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue