1import ./make-test-python.nix ({ pkgs, ...} :
2
3{
4 name = "plasma5";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ ttuegel ];
7 };
8
9 machine = { ... }:
10
11 {
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.enable = true;
17 services.xserver.displayManager.autoLogin = {
18 enable = true;
19 user = "alice";
20 };
21 hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
22 };
23
24 testScript = { nodes, ... }: let
25 user = nodes.machine.config.users.users.alice;
26 xdo = "${pkgs.xdotool}/bin/xdotool";
27 in ''
28 with subtest("Wait for login"):
29 start_all()
30 machine.wait_for_file("${user.home}/.Xauthority")
31 machine.succeed("xauth merge ${user.home}/.Xauthority")
32
33 with subtest("Check plasmashell started"):
34 machine.wait_until_succeeds("pgrep plasmashell")
35 machine.wait_for_window("^Desktop ")
36
37 with subtest("Check that KDED is running"):
38 machine.succeed("pgrep kded5")
39
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}")
42
43 with subtest("Run Dolphin"):
44 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
45 machine.wait_for_window(" Dolphin")
46
47 with subtest("Run Konsole"):
48 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
49 machine.wait_for_window("Konsole")
50
51 with subtest("Run systemsettings"):
52 machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
53 machine.wait_for_window("Settings")
54
55 with subtest("Wait to get a screenshot"):
56 machine.execute(
57 "${xdo} key Alt+F1 sleep 10"
58 )
59 machine.screenshot("screen")
60 '';
61})