Skip to content

Commit

Permalink
tests: add new OSBUILD_TEST_QEMU_GUI env to make debugging easier
Browse files Browse the repository at this point in the history
When running tests locally it can be useful to have a full qemu
gui. E.g. the install test is not putting anything on the serial
port AFAICT. So the new environment `OSBUILD_TEST_QEMU_GUI=1` will
bring up a graphical qemu during the tests.

Use as e.g.
```
$ sudo OSBUILD_TEST_QEMU_GUI=1 pytest -s -vv -rs './test/test_build.py::test_iso_installs[iso]'
```
  • Loading branch information
mvo5 committed Jan 25, 2024
1 parent 529f919 commit 740a549
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ def start(self, wait_event="ssh", snapshot=True, use_ovmf=False):
"-m", self.MEM,
# get "illegal instruction" inside the VM otherwise
"-cpu", "host",
"-nographic",
"-serial", "stdio",
"-monitor", "none",
"-netdev", f"user,id=net.0,hostfwd=tcp::{self._ssh_port}-:22",
"-device", "rtl8139,netdev=net.0",
"-qmp", f"unix:{self._qmp_socket},server,nowait",
]
if not os.environ.get("OSBUILD_TEST_QEMU_GUI"):
qemu_cmdline.append("-nographic")
if use_ovmf:
qemu_cmdline.extend(["-bios", find_ovmf()])
if self._cdrom:
Expand Down

0 comments on commit 740a549

Please sign in to comment.