2018-11-11 09:41:11 +01:00
|
|
|
{ system ? builtins.currentSystem,
|
|
|
|
config ? {},
|
|
|
|
pkgs ? import ../.. { inherit system config; }
|
|
|
|
}:
|
2017-03-24 16:38:16 +01:00
|
|
|
|
2019-11-07 02:55:18 +01:00
|
|
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
2017-03-24 16:38:16 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
default = {
|
|
|
|
name = "sddm";
|
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { ... }: {
|
2017-03-24 16:38:16 +01:00
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.displayManager.sddm.enable = true;
|
2019-12-10 15:10:30 +01:00
|
|
|
services.xserver.displayManager.defaultSession = "none+icewm";
|
2017-03-24 16:38:16 +01:00
|
|
|
services.xserver.windowManager.icewm.enable = true;
|
|
|
|
};
|
2015-11-22 19:48:37 +01:00
|
|
|
|
2017-03-24 16:38:16 +01:00
|
|
|
enableOCR = true;
|
|
|
|
|
|
|
|
testScript = { nodes, ... }: let
|
2023-06-23 16:41:57 +02:00
|
|
|
user = nodes.machine.users.users.alice;
|
2017-03-24 16:38:16 +01:00
|
|
|
in ''
|
2019-11-07 02:55:18 +01:00
|
|
|
start_all()
|
2019-11-12 18:46:02 +01:00
|
|
|
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 ")
|
2017-03-24 16:38:16 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
autoLogin = {
|
|
|
|
name = "sddm-autologin";
|
2021-01-10 20:08:30 +01:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2017-03-24 16:38:16 +01:00
|
|
|
maintainers = [ ttuegel ];
|
|
|
|
};
|
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { ... }: {
|
2017-03-24 16:38:16 +01:00
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
2020-04-12 12:43:50 +02:00
|
|
|
services.xserver.displayManager = {
|
|
|
|
sddm.enable = true;
|
2017-03-24 16:38:16 +01:00
|
|
|
autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
|
|
|
};
|
2019-12-10 15:10:30 +01:00
|
|
|
services.xserver.displayManager.defaultSession = "none+icewm";
|
2017-03-24 16:38:16 +01:00
|
|
|
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 ")
|
2017-03-24 16:38:16 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.mapAttrs (lib.const makeTest) tests
|