summaryrefslogtreecommitdiffstats
path: root/nixos/lib/test-driver
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2021-05-04 16:12:11 +0200
committerMichael Weiss <dev.primeos@gmail.com>2021-05-04 16:23:02 +0200
commit3c1a76611e17d74322696c73496fae349ab96de7 (patch)
tree483a3f0be1a1c08a4647c6487bd4660c3add15ed /nixos/lib/test-driver
parent0c75a43d6260072d79f80bc2f81357b97046e13b (diff)
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).
Diffstat (limited to 'nixos/lib/test-driver')
-rw-r--r--nixos/lib/test-driver/test-driver.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py
index 7800a49e4107..270a5969cda5 100644
--- a/nixos/lib/test-driver/test-driver.py
+++ b/nixos/lib/test-driver/test-driver.py
@@ -735,6 +735,7 @@ class Machine:
shell_path = os.path.join(self.state_dir, "shell")
self.shell_socket = create_socket(shell_path)
+ display_available = any(x in os.environ for x in ["DISPLAY", "WAYLAND_DISPLAY"])
qemu_options = (
" ".join(
[
@@ -744,7 +745,7 @@ class Machine:
"-device virtio-serial",
"-device virtconsole,chardev=shell",
"-device virtio-rng-pci",
- "-serial stdio" if "DISPLAY" in os.environ else "-nographic",
+ "-serial stdio" if display_available else "-nographic",
]
)
+ " "