nixpkgs/tests/kde4.nix
Eelco Dolstra a8aefffa09 * Test whether logging into X assigns device ownership properly.
svn path=/nixos/trunk/; revision=20486
2010-03-09 11:43:56 +00:00

56 lines
1.5 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";
};
};
testScript =
''
$machine->waitForWindow(qr/plasma-desktop/);
# Check that logging in has given the user ownership of devices.
$machine->mustSucceed("getfacl /dev/snd/timer | grep -q alice");
$machine->execute("su - alice -c 'DISPLAY=:0.0 kwrite /var/log/messages &'");
$machine->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://localhost/ &'");
$machine->waitForWindow(qr/messages.*KWrite/);
$machine->waitForWindow(qr/Valgrind.*Konqueror/);
sleep 5;
$machine->screenshot("screen");
'';
}