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;
25 # Silence log spam due to no sound drivers loaded:
26 # ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
27 hardware.pulseaudio.enable = true;
32 testScript = { nodes, ... }:
34 user = nodes.machine.users.users.alice;
35 env = "DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
38 with subtest("Wait for login"):
40 machine.wait_for_file("${user.home}/.Xauthority")
41 machine.succeed("xauth merge ${user.home}/.Xauthority")
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("Check if MATE session components actually start"):
47 machine.wait_until_succeeds("pgrep marco")
48 machine.wait_for_window("marco")
49 machine.wait_until_succeeds("pgrep mate-panel")
50 machine.wait_for_window("Top Panel")
51 machine.wait_for_window("Bottom Panel")
52 machine.wait_until_succeeds("pgrep caja")
53 machine.wait_for_window("Caja")
54 machine.wait_for_text('(Applications|Places|System)')
55 machine.wait_for_text('(Computer|Home|Trash)')
57 with subtest("Check if various environment variables are set"):
58 machine.succeed("xargs --null --max-args=1 echo < /proc/$(pgrep -xf marco)/environ | grep 'XDG_CURRENT_DESKTOP' | grep 'MATE'")
59 # From mate-panel-with-applets packaging
60 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}'")
62 with subtest("Check if applets are built with in-process support"):
63 # This is needed for Wayland support
64 machine.fail("pgrep -fa clock-applet")
66 with subtest("Lock the screen"):
67 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
68 machine.succeed("su - ${user.name} -c '${env} mate-screensaver-command -l >&2 &'")
69 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is active'")
71 machine.send_chars("${user.password}", delay=0.2)
72 machine.wait_for_text("${user.description}")
73 machine.screenshot("screensaver")
74 machine.send_chars("\n")
75 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
77 with subtest("Open MATE control center"):
78 machine.succeed("su - ${user.name} -c '${env} mate-control-center >&2 &'")
79 machine.wait_for_window("Control Center")
80 machine.wait_for_text('(Groups|Administration|Hardware)')
82 with subtest("Open MATE terminal"):
83 machine.succeed("su - ${user.name} -c '${env} mate-terminal >&2 &'")
84 machine.wait_for_window("Terminal")
86 with subtest("Check if MATE has ever coredumped"):
87 machine.fail("coredumpctl --json=short | grep -E 'mate|marco|caja'")
88 machine.screenshot("screen")