mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
Merge pull request #31198 from Lassulus/test-display
nixos/test-instrumentation: take DISPLAY from system-config
This commit is contained in:
commit
b11ac5d29d
@ -602,8 +602,11 @@ 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/X0 ]");
|
||||
($status, $out) = $self->execute("[ -e /tmp/.X11-unix/X$display ]");
|
||||
return 1 if $status == 0;
|
||||
}
|
||||
});
|
||||
|
@ -5,9 +5,10 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let kernel = config.boot.kernelPackages.kernel; in
|
||||
|
||||
{
|
||||
let
|
||||
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
|
||||
# modules/virtualisation/qemu-vm.nix gets merged with the same option defined
|
||||
@ -28,7 +29,7 @@ let kernel = config.boot.kernelPackages.kernel; in
|
||||
''
|
||||
export USER=root
|
||||
export HOME=/root
|
||||
export DISPLAY=:0.0
|
||||
export DISPLAY=:${toString display}
|
||||
|
||||
source /etc/profile
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user