3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/tests/kde4.nix
Eelco Dolstra 51097933ab * Moved test-related stuff from lib/build-vms.nix to lib/testing.nix.
* Factored out some commonality between tests to make them a bit
  simpler to write.  A test is a function { pkgs, ... }: -> { nodes,
  testScript } or { machine, testScript }.  So it's no longer
  necessary to have a "vms" attribute in every test.

svn path=/nixos/trunk/; revision=19220
2010-01-05 11:18:43 +00:00

57 lines
1.4 KiB
Nix

{ pkgs, ... }:
{
machine =
{ config, pkgs, ... }:
{ services.xserver.enable = true;
services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org";
services.httpd.documentRoot = "${pkgs.valgrind}/share/doc/valgrind/html";
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
'';
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;
password = "foobar";
};
environment.systemPackages = [ pkgs.scrot ];
};
testScript =
''
$machine->waitForFile("/tmp/.X11-unix/X0");
sleep 70;
print STDERR $machine->execute("su - alice -c 'DISPLAY=:0.0 kwrite /var/log/messages &'");
sleep 10;
print STDERR $machine->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://localhost/ &'");
sleep 10;
print STDERR $machine->mustSucceed("DISPLAY=:0.0 scrot /hostfs/$ENV{out}/screen.png");
'';
}