mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
* Start of a simple GUI test. Right now it just starts the X server,
wait a few seconds and makes a screenshot. svn path=/nixos/trunk/; revision=16934
This commit is contained in:
parent
484580dbbd
commit
cddc93cc5e
|
@ -187,6 +187,18 @@ sub waitForJob {
|
|||
}
|
||||
|
||||
|
||||
# Wait until the specified file exists.
|
||||
sub waitForFile {
|
||||
my ($self, $fileName) = @_;
|
||||
while (1) {
|
||||
my ($status, $out) = $self->execute("test -e $fileName");
|
||||
return if $status == 0;
|
||||
sleep 1;
|
||||
# !!! need a timeout
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub stopJob {
|
||||
my ($self, $jobName) = @_;
|
||||
$self->execute("initctl stop $jobName");
|
||||
|
|
44
tests/kde4.nix
Normal file
44
tests/kde4.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ nixos ? ./..
|
||||
, nixpkgs ? /etc/nixos/nixpkgs
|
||||
, services ? /etc/nixos/services
|
||||
, system ? builtins.currentSystem
|
||||
}:
|
||||
|
||||
with import ../lib/build-vms.nix { inherit nixos nixpkgs services system; };
|
||||
|
||||
rec {
|
||||
|
||||
nodes =
|
||||
{ client =
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ services.xserver.enable = true;
|
||||
services.xserver.desktopManager.default = "kde4";
|
||||
services.xserver.desktopManager.kde4.enable = true;
|
||||
|
||||
users.extraUsers = pkgs.lib.singleton
|
||||
{ name = "alice";
|
||||
description = "Alice Foobar";
|
||||
home = "/home/alice";
|
||||
createHome = true;
|
||||
useDefaultShell = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.xorg.xclock pkgs.xorg.xwd ];
|
||||
};
|
||||
};
|
||||
|
||||
vms = buildVirtualNetwork { inherit nodes; };
|
||||
|
||||
test = runTests vms
|
||||
''
|
||||
startAll;
|
||||
|
||||
$client->waitForFile("/tmp/.X11-unix/X0");
|
||||
|
||||
sleep 20;
|
||||
|
||||
print STDERR $client->execute("DISPLAY=:0.0 xwd -root > /hostfs/$ENV{out}/screen.xwd");
|
||||
'';
|
||||
|
||||
}
|
Loading…
Reference in a new issue