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