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.xserver.displayManager.sddm.enable = true;
15 services.xserver.displayManager.defaultSession = "plasma";
16 services.xserver.desktopManager.plasma5 = {
18 excludePackages = [ pkgs.plasma5Packages.elisa ];
20 services.xserver.displayManager.autoLogin = {
24 hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
27 testScript = { nodes, ... }: let
28 user = nodes.machine.config.users.users.alice;
29 xdo = "${pkgs.xdotool}/bin/xdotool";
31 with subtest("Wait for login"):
33 machine.wait_for_file("${user.home}/.Xauthority")
34 machine.succeed("xauth merge ${user.home}/.Xauthority")
36 with subtest("Check plasmashell started"):
37 machine.wait_until_succeeds("pgrep plasmashell")
38 machine.wait_for_window("^Desktop ")
40 with subtest("Check that KDED is running"):
41 machine.succeed("pgrep kded5")
43 with subtest("Check that logging in has given the user ownership of devices"):
44 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
46 with subtest("Ensure Elisa is not installed"):
47 machine.fail("which elisa")
49 with subtest("Run Dolphin"):
50 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
51 machine.wait_for_window(" Dolphin")
53 with subtest("Run Konsole"):
54 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
55 machine.wait_for_window("Konsole")
57 with subtest("Run systemsettings"):
58 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
59 machine.wait_for_window("Settings")
61 with subtest("Wait to get a screenshot"):
63 "${xdo} key Alt+F1 sleep 10"
65 machine.screenshot("screen")