debian-forge/test/test_boot.py
Lars Karlitski 2205e972d3 test: move temporary store to osbuildtest.TestCase
All tests will need a store. There's no need for each to create a
temporary directory.
2019-09-30 08:36:50 +02:00

29 lines
802 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", capture_output=True, check=True)
self.assertEqual(r.stdout.strip(), "running")