nixpkgs/nixos/tests/sddm.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.8 KiB
Nix
Raw Normal View History

{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
}:
2019-11-07 02:55:18 +01:00
with import ../lib/testing-python.nix { inherit system pkgs; };
let
inherit (pkgs) lib;
tests = {
default = {
name = "sddm";
2022-03-21 00:15:30 +01:00
nodes.machine = { ... }: {
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.defaultSession = "none+icewm";
services.xserver.windowManager.icewm.enable = true;
};
2015-11-22 19:48:37 +01:00
enableOCR = true;
testScript = { nodes, ... }: let
2023-06-23 16:41:57 +02:00
user = nodes.machine.users.users.alice;
in ''
2019-11-07 02:55:18 +01:00
start_all()
machine.wait_for_text("(?i)select your user")
2019-11-07 02:55:18 +01:00
machine.screenshot("sddm")
machine.send_chars("${user.password}\n")
2023-06-23 16:41:57 +02:00
machine.wait_for_file("/tmp/xauth_*")
machine.succeed("xauth merge /tmp/xauth_*")
2019-11-07 02:55:18 +01:00
machine.wait_for_window("^IceWM ")
'';
};
autoLogin = {
name = "sddm-autologin";
meta = with pkgs.lib.maintainers; {
maintainers = [ ttuegel ];
};
2022-03-21 00:15:30 +01:00
nodes.machine = { ... }: {
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager = {
sddm.enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.displayManager.defaultSession = "none+icewm";
services.xserver.windowManager.icewm.enable = true;
};
2023-06-23 16:41:57 +02:00
testScript = { nodes, ... }: ''
2019-11-07 02:55:18 +01:00
start_all()
2023-06-23 16:41:57 +02:00
machine.wait_for_file("/tmp/xauth_*")
machine.succeed("xauth merge /tmp/xauth_*")
2019-11-07 02:55:18 +01:00
machine.wait_for_window("^IceWM ")
'';
};
};
in
lib.mapAttrs (lib.const makeTest) tests