nixos/test-driver: Allow interactive testing on Wayland-only setups
On my system I have XWayland disabled and therefore only WAYLAND_DISPLAY is set. This ensures that the graphical output will still be enabled on such setups (both Wayland and X11 are supported by the viewer).
This commit is contained in:
parent
0c75a43d62
commit
3c1a76611e
@ -735,6 +735,7 @@ class Machine:
|
|||||||
shell_path = os.path.join(self.state_dir, "shell")
|
shell_path = os.path.join(self.state_dir, "shell")
|
||||||
self.shell_socket = create_socket(shell_path)
|
self.shell_socket = create_socket(shell_path)
|
||||||
|
|
||||||
|
display_available = any(x in os.environ for x in ["DISPLAY", "WAYLAND_DISPLAY"])
|
||||||
qemu_options = (
|
qemu_options = (
|
||||||
" ".join(
|
" ".join(
|
||||||
[
|
[
|
||||||
@ -744,7 +745,7 @@ class Machine:
|
|||||||
"-device virtio-serial",
|
"-device virtio-serial",
|
||||||
"-device virtconsole,chardev=shell",
|
"-device virtconsole,chardev=shell",
|
||||||
"-device virtio-rng-pci",
|
"-device virtio-rng-pci",
|
||||||
"-serial stdio" if "DISPLAY" in os.environ else "-nographic",
|
"-serial stdio" if display_available else "-nographic",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
+ " "
|
+ " "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user