1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
5 maintainers = lib.teams.mate.members;
8 nodes.machine = { ... }: {
10 ./common/user-account.nix
13 services.xserver.enable = true;
15 services.xserver.displayManager = {
16 lightdm.enable = true;
23 services.xserver.desktopManager.mate.enable = true;
28 testScript = { nodes, ... }:
30 user = nodes.machine.users.users.alice;
31 env = "DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
34 with subtest("Wait for login"):
36 machine.wait_for_file("${user.home}/.Xauthority")
37 machine.succeed("xauth merge ${user.home}/.Xauthority")
39 with subtest("Check that logging in has given the user ownership of devices"):
40 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
42 with subtest("Check if MATE session components actually start"):
43 machine.wait_until_succeeds("pgrep marco")
44 machine.wait_for_window("marco")
45 machine.wait_until_succeeds("pgrep mate-panel")
46 machine.wait_for_window("Top Panel")
47 machine.wait_for_window("Bottom Panel")
48 machine.wait_until_succeeds("pgrep caja")
49 machine.wait_for_window("Caja")
50 machine.wait_for_text('(Applications|Places|System)')
51 machine.wait_for_text('(Computer|Home|Trash)')
53 with subtest("Check if various environment variables are set"):
54 machine.succeed("xargs --null --max-args=1 echo < /proc/$(pgrep -xf marco)/environ | grep 'XDG_CURRENT_DESKTOP' | grep 'MATE'")
55 # From mate-panel-with-applets packaging
56 machine.succeed("xargs --null --max-args=1 echo < /proc/$(pgrep -xf mate-panel)/environ | grep 'MATE_PANEL_APPLETS_DIR' | grep '${pkgs.mate.mate-panel-with-applets.pname}'")
58 with subtest("Check if applets are built with in-process support"):
59 # This is needed for Wayland support
60 machine.fail("pgrep -fa clock-applet")
62 with subtest("Lock the screen"):
63 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
64 machine.succeed("su - ${user.name} -c '${env} mate-screensaver-command -l >&2 &'")
65 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is active'")
67 machine.send_chars("${user.password}", delay=0.2)
68 machine.wait_for_text("${user.description}")
69 machine.screenshot("screensaver")
70 machine.send_chars("\n")
71 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
73 with subtest("Open MATE control center"):
74 machine.succeed("su - ${user.name} -c '${env} mate-control-center >&2 &'")
75 machine.wait_for_window("Control Center")
76 machine.wait_for_text('(Groups|Administration|Hardware)')
78 with subtest("Open MATE terminal"):
79 machine.succeed("su - ${user.name} -c '${env} mate-terminal >&2 &'")
80 machine.wait_for_window("Terminal")
82 with subtest("Check if MATE has ever coredumped"):
83 machine.fail("coredumpctl --json=short | grep -E 'mate|marco|caja'")
84 machine.screenshot("screen")