nixpkgs-suyu/nixos/tests/gnome3-gdm.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2015-09-15 14:25:19 +02:00
import ./make-test.nix ({ pkgs, ...} : {
name = "gnome3-gdm";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lethalman ];
};
machine =
{ ... }:
2015-09-15 14:25:19 +02:00
{ imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.gdm = {
enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.desktopManager.gnome3.enable = true;
virtualisation.memorySize = 1024;
2015-09-15 14:25:19 +02:00
};
testScript =
''
# wait for gdm to start and bring up X
$machine->waitForUnit("display-manager.service");
2015-09-15 14:25:19 +02:00
$machine->waitForX;
# wait for alice to be logged in
$machine->waitForUnit("default.target","alice");
2015-09-15 14:25:19 +02:00
# Check that logging in has given the user ownership of devices.
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
# open a terminal and check it's there
$machine->succeed("su - alice -c 'DISPLAY=:0.0 XAUTHORITY=/run/user/\$UID/gdm/Xauthority gnome-terminal'");
$machine->succeed("xauth merge /run/user/1000/gdm/Xauthority");
2015-09-15 14:25:19 +02:00
$machine->waitForWindow(qr/Terminal/);
# wait to get a nice screenshot
2015-09-15 14:25:19 +02:00
$machine->sleep(20);
$machine->screenshot("screen");
'';
})