From 00344162a7d1a4ed438e863b99652cf298b2ad00 Mon Sep 17 00:00:00 2001 From: Joerg Thalheim Date: Wed, 8 Nov 2017 17:03:59 +0000 Subject: [PATCH] Revert "nixos/test-instrumentation: softcode DISPLAY" This reverts commit 4531ec59551fa3f3c9dfb442dff2ec669c467922. This broke waitForX: https://github.com/NixOS/nixpkgs/commit/b11ac5d29dcccdb7474a23ac1d8a6c40553adcd5#commitcomment-25486347 cc @Lassulus --- nixos/lib/test-driver/Machine.pm | 5 +---- nixos/modules/testing/test-instrumentation.nix | 9 ++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm index dbed242eb86..a7ed5d1faa3 100644 --- a/nixos/lib/test-driver/Machine.pm +++ b/nixos/lib/test-driver/Machine.pm @@ -602,11 +602,8 @@ sub waitForX { $self->nest("waiting for the X11 server", sub { retry sub { my ($status, $out) = $self->execute("journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'"); - my $display = $ENV{'DISPLAY'}; - $display =~ s/://; - return 0 if $status != 0; - ($status, $out) = $self->execute("[ -e /tmp/.X11-unix/X$display ]"); + ($status, $out) = $self->execute("[ -e /tmp/.X11-unix/X0 ]"); return 1 if $status == 0; } }); diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 2465e99e9c1..7f5b55d5cca 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -5,10 +5,9 @@ with lib; -let - display = (d: if d == null then 0 else d) config.services.xserver.display; - kernel = config.boot.kernelPackages.kernel; -in { +let kernel = config.boot.kernelPackages.kernel; in + +{ # This option is a dummy that if used in conjunction with # modules/virtualisation/qemu-vm.nix gets merged with the same option defined @@ -29,7 +28,7 @@ in { '' export USER=root export HOME=/root - export DISPLAY=:${toString display} + export DISPLAY=:0.0 source /etc/profile