test: test qemu assembler

Similar to the existing test, but uses qemu-nbd to mount the generated
image.

Using unittest.TestCase.subTest() for now, which means that the tests
aren't very independent. I think this is fine in this case, because
we're testing images independently from each other, reusing the base
tree in the store.
This commit is contained in:
Lars Karlitski 2019-10-07 14:23:50 +02:00 committed by Tom Gundersen
parent eab8cbff5e
commit 2819d07296
3 changed files with 75 additions and 22 deletions

View file

@ -101,7 +101,7 @@ def main(tree, output_dir, options, loop_client):
extra_args = []
# raw and vdi don't suppport compression
if fmt != "raw" and fmt != "vdi":
if fmt not in ("raw", "vdi"):
extra_args.append("-c")
subprocess.run(["qemu-img", "convert", "-O", fmt, *extra_args, image, f"{output_dir}/{filename}"], check=True)