1 import ./make-test-python.nix ({ pkgs, ...} :
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ ttuegel ];
9 nodes.machine = { ... }:
12 imports = [ ./common/user-account.nix ];
13 services.xserver.enable = true;
14 services.displayManager.sddm.enable = true;
15 services.displayManager.defaultSession = "plasma";
16 services.xserver.desktopManager.plasma5.enable = true;
17 environment.plasma5.excludePackages = [ pkgs.plasma5Packages.elisa ];
18 services.displayManager.autoLogin = {
24 testScript = { nodes, ... }: let
25 user = nodes.machine.users.users.alice;
26 xdo = "${pkgs.xdotool}/bin/xdotool";
28 with subtest("Wait for login"):
30 machine.wait_for_file("/tmp/xauth_*")
31 machine.succeed("xauth merge /tmp/xauth_*")
33 with subtest("Check plasmashell started"):
34 machine.wait_until_succeeds("pgrep plasmashell")
35 machine.wait_for_window("^Desktop ")
37 with subtest("Check that KDED is running"):
38 machine.succeed("pgrep kded5")
40 with subtest("Check that logging in has given the user ownership of devices"):
41 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
43 with subtest("Ensure Elisa is not installed"):
44 machine.fail("which elisa")
46 machine.succeed("su - ${user.name} -c 'xauth merge /tmp/xauth_*'")
48 with subtest("Run Dolphin"):
49 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
50 machine.wait_for_window(" Dolphin")
52 with subtest("Run Konsole"):
53 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
54 machine.wait_for_window("Konsole")
56 with subtest("Run systemsettings"):
57 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
58 machine.wait_for_window("Settings")
60 with subtest("Wait to get a screenshot"):
62 "${xdo} key Alt+F1 sleep 10"
64 machine.screenshot("screen")