Revert "nixos/test-instrumentation: softcode DISPLAY"

This reverts commit 4531ec5955.

This broke waitForX: b11ac5d29d (commitcomment-25486347)

cc @Lassulus
This commit is contained in:
Joerg Thalheim 2017-11-08 17:03:59 +00:00
parent f162d54b76
commit 00344162a7
2 changed files with 5 additions and 9 deletions

View File

@ -602,11 +602,8 @@ sub waitForX {
$self->nest("waiting for the X11 server", sub { $self->nest("waiting for the X11 server", sub {
retry sub { retry sub {
my ($status, $out) = $self->execute("journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'"); my ($status, $out) = $self->execute("journalctl -b SYSLOG_IDENTIFIER=systemd | grep 'session opened'");
my $display = $ENV{'DISPLAY'};
$display =~ s/://;
return 0 if $status != 0; 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; return 1 if $status == 0;
} }
}); });

View File

@ -5,10 +5,9 @@
with lib; with lib;
let let kernel = config.boot.kernelPackages.kernel; in
display = (d: if d == null then 0 else d) config.services.xserver.display;
kernel = config.boot.kernelPackages.kernel; {
in {
# This option is a dummy that if used in conjunction with # This option is a dummy that if used in conjunction with
# modules/virtualisation/qemu-vm.nix gets merged with the same option defined # modules/virtualisation/qemu-vm.nix gets merged with the same option defined
@ -29,7 +28,7 @@ in {
'' ''
export USER=root export USER=root
export HOME=/root export HOME=/root
export DISPLAY=:${toString display} export DISPLAY=:0.0
source /etc/profile source /etc/profile