at master 3.7 kB view raw
1{ pkgs, lib, ... }: 2{ 3 name = "mate"; 4 5 meta = { 6 maintainers = lib.teams.mate.members; 7 }; 8 9 nodes.machine = 10 { ... }: 11 { 12 imports = [ 13 ./common/user-account.nix 14 ]; 15 16 services.xserver.enable = true; 17 18 services.xserver.displayManager = { 19 lightdm.enable = true; 20 autoLogin = { 21 enable = true; 22 user = "alice"; 23 }; 24 }; 25 26 services.xserver.desktopManager.mate.enable = true; 27 }; 28 29 enableOCR = true; 30 31 testScript = 32 { nodes, ... }: 33 let 34 user = nodes.machine.users.users.alice; 35 env = "DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus"; 36 in 37 '' 38 with subtest("Wait for login"): 39 machine.wait_for_x() 40 machine.wait_for_file("${user.home}/.Xauthority") 41 machine.succeed("xauth merge ${user.home}/.Xauthority") 42 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}") 45 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)') 56 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}'") 61 # From the nixos/mate module 62 machine.succeed("xargs --null --max-args=1 echo < /proc/$(pgrep -xf mate-panel)/environ | grep 'SSH_AUTH_SOCK' | grep 'gcr'") 63 64 with subtest("Check if applets are built with in-process support"): 65 # This is needed for Wayland support 66 machine.fail("pgrep -fa clock-applet") 67 68 with subtest("Lock the screen"): 69 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'") 70 machine.succeed("su - ${user.name} -c '${env} mate-screensaver-command -l >&2 &'") 71 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is active'") 72 machine.sleep(2) 73 machine.send_chars("${user.password}", delay=0.2) 74 machine.wait_for_text("${user.description}") 75 machine.screenshot("screensaver") 76 machine.send_chars("\n") 77 machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'") 78 79 with subtest("Open MATE control center"): 80 machine.succeed("su - ${user.name} -c '${env} mate-control-center >&2 &'") 81 machine.wait_for_window("Control Center") 82 machine.wait_for_text('(Groups|Administration|Hardware)') 83 84 with subtest("Open MATE terminal"): 85 machine.succeed("su - ${user.name} -c '${env} mate-terminal >&2 &'") 86 machine.wait_for_window("Terminal") 87 88 with subtest("Check if MATE has ever coredumped"): 89 machine.fail("coredumpctl --json=short | grep -E 'mate|marco|caja'") 90 machine.screenshot("screen") 91 ''; 92}