2009-09-02 16:48:28 +02:00
|
|
|
{ nixos ? ./..
|
2009-11-12 00:54:54 +01:00
|
|
|
, nixpkgs ? ../../nixpkgs
|
|
|
|
, services ? ../../nixos/services
|
2009-09-02 16:48:28 +02:00
|
|
|
, system ? builtins.currentSystem
|
|
|
|
}:
|
|
|
|
|
|
|
|
with import ../lib/build-vms.nix { inherit nixos nixpkgs services system; };
|
|
|
|
|
|
|
|
rec {
|
|
|
|
|
|
|
|
nodes =
|
|
|
|
{ client =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{ services.xserver.enable = true;
|
2009-09-02 20:44:09 +02:00
|
|
|
|
2009-09-04 17:02:52 +02:00
|
|
|
services.httpd.enable = true;
|
|
|
|
services.httpd.adminAddr = "foo@example.org";
|
|
|
|
services.httpd.documentRoot = "${pkgs.valgrind}/share/doc/valgrind/html";
|
|
|
|
|
2009-09-02 20:44:09 +02:00
|
|
|
services.xserver.displayManager.slim.enable = false;
|
|
|
|
services.xserver.displayManager.kdm.enable = true;
|
|
|
|
services.xserver.displayManager.kdm.extraConfig =
|
|
|
|
''
|
|
|
|
[X-:0-Core]
|
|
|
|
AutoLoginEnable=true
|
|
|
|
AutoLoginUser=alice
|
|
|
|
AutoLoginPass=foobar
|
|
|
|
'';
|
|
|
|
|
2009-09-02 16:48:28 +02:00
|
|
|
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;
|
2009-09-02 20:44:09 +02:00
|
|
|
password = "foobar";
|
2009-09-02 16:48:28 +02:00
|
|
|
};
|
|
|
|
|
2009-09-03 01:16:33 +02:00
|
|
|
environment.systemPackages = [ pkgs.scrot ];
|
2009-09-02 16:48:28 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
vms = buildVirtualNetwork { inherit nodes; };
|
|
|
|
|
|
|
|
test = runTests vms
|
|
|
|
''
|
|
|
|
startAll;
|
|
|
|
|
|
|
|
$client->waitForFile("/tmp/.X11-unix/X0");
|
|
|
|
|
2009-09-04 17:33:21 +02:00
|
|
|
sleep 70;
|
2009-09-04 17:02:52 +02:00
|
|
|
|
2009-09-04 17:26:30 +02:00
|
|
|
print STDERR $client->execute("su - alice -c 'DISPLAY=:0.0 kwrite /var/log/messages &'");
|
|
|
|
|
|
|
|
sleep 10;
|
|
|
|
|
2009-09-04 17:02:52 +02:00
|
|
|
print STDERR $client->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://localhost/ &'");
|
2009-09-02 16:48:28 +02:00
|
|
|
|
2009-09-04 17:02:52 +02:00
|
|
|
sleep 10;
|
|
|
|
|
2010-01-04 17:30:54 +01:00
|
|
|
print STDERR $client->mustSucceed("DISPLAY=:0.0 scrot /hostfs/$ENV{out}/screen.png");
|
2009-09-02 16:48:28 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|