1 import ./make-test-python.nix ({ pkgs, ...} : {
9 ./common/user-account.nix
12 services.xserver.enable = true;
13 services.xserver.displayManager.lightdm.enable = true;
15 services.displayManager.autoLogin = {
20 services.xserver.desktopManager.xfce.enable = true;
21 environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
26 testScript = { nodes, ... }: let
27 user = nodes.machine.users.users.alice;
28 bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
30 with subtest("Wait for login"):
32 machine.wait_for_file("${user.home}/.Xauthority")
33 machine.succeed("xauth merge ${user.home}/.Xauthority")
35 with subtest("Check that logging in has given the user ownership of devices"):
36 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
38 with subtest("Check if Xfce components actually start"):
39 machine.wait_for_window("xfce4-panel")
40 machine.wait_for_window("Desktop")
41 for i in ["xfwm4", "xfsettingsd", "xfdesktop", "xfce4-screensaver", "xfce4-notifyd", "xfconfd"]:
42 machine.wait_until_succeeds(f"pgrep -f {i}")
44 with subtest("Open whiskermenu"):
45 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1 -t string -s whiskermenu -n >&2 &'")
46 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1/stay-on-focus-out -t bool -s true -n >&2 &'")
47 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-panel -r >&2 &'")
48 machine.wait_until_succeeds("journalctl -b --grep 'xfce4-panel: Restarting' -t xsession")
50 machine.wait_until_succeeds("pgrep -f libwhiskermenu")
51 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
52 machine.wait_for_text('Mail Reader')
54 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
56 with subtest("Open Xfce terminal"):
57 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 xfce4-terminal >&2 &'")
58 machine.wait_for_window("Terminal")
60 with subtest("Open Thunar"):
61 machine.succeed("su - ${user.name} -c 'DISPLAY=:0 thunar >&2 &'")
62 machine.wait_for_window("Thunar")
63 machine.wait_for_text('(Pictures|Public|Templates|Videos)')
65 with subtest("Check if any coredumps are found"):
66 machine.succeed("(coredumpctl --json=short 2>&1 || true) | grep 'No coredumps found'")
68 machine.screenshot("screen")