3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/sddm.nix
aszlig 5d5c0d590f
Revert "sddm: Fix test."
This reverts commit 0a6a06346a.

The commit replaced the text to search for from ALICE to BOB, because
our OCR detection only caught "BOB FOOBAR" but missed "ALICE FOOBAR"
completely.

With the improvements to our OCR system this no longer is the case and
the test passes successfully with this reverted.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @shlevy
2017-04-11 03:21:58 +02:00

67 lines
1.9 KiB
Nix

{ system ? builtins.currentSystem }:
with import ../lib/testing.nix { inherit system; };
let
inherit (pkgs) lib;
tests = {
default = {
name = "sddm";
machine = { lib, ... }: {
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.windowManager.default = "icewm";
services.xserver.windowManager.icewm.enable = true;
services.xserver.desktopManager.default = "none";
};
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.extraUsers.alice;
in ''
startAll;
$machine->waitForText(qr/ALICE/);
$machine->screenshot("sddm");
$machine->sendChars("${user.password}\n");
$machine->waitForFile("/home/alice/.Xauthority");
$machine->succeed("xauth merge ~alice/.Xauthority");
$machine->waitForWindow("^IceWM ");
'';
};
autoLogin = {
name = "sddm-autologin";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ttuegel ];
};
machine = { lib, ... }: {
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.sddm = {
enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.windowManager.default = "icewm";
services.xserver.windowManager.icewm.enable = true;
services.xserver.desktopManager.default = "none";
};
testScript = { nodes, ... }: ''
startAll;
$machine->waitForFile("/home/alice/.Xauthority");
$machine->succeed("xauth merge ~alice/.Xauthority");
$machine->waitForWindow("^IceWM ");
'';
};
};
in
lib.mapAttrs (lib.const makeTest) tests