debian-forge/test/test_boot.py
Lars Karlitski 0be34c8bcc test_boot: show stderr of qemu process
We're only interested in capturing stdout. It might be useful to see
what qemu prints on stderr.
2019-10-02 15:10:37 +02:00

29 lines
805 B
Python

import subprocess
import unittest
from . import osbuildtest
class TestBoot(osbuildtest.TestCase):
def test_boot(self):
_, output_id = self.run_osbuild("test/pipelines/f30-boot.json")
r = subprocess.run(["qemu-system-x86_64",
"-snapshot",
"-m", "1024",
"-accel", "kvm:hvf:tcg",
# be silent
"-nographic",
"-monitor", "none",
"-serial", "none",
# create /dev/vport0p1
"-chardev", "stdio,id=stdio",
"-device", "virtio-serial",
"-device", "virtserialport,chardev=stdio",
f"{self.store}/refs/{output_id}/f30-boot.qcow2"
], encoding="utf-8", stdout=subprocess.PIPE, check=True)
self.assertEqual(r.stdout.strip(), "running")