at 24.11-pre 3.7 kB view raw
1import ./make-test-python.nix ({ pkgs, lib, ... }: { 2 name = "mate"; 3 4 meta = { 5 maintainers = lib.teams.mate.members; 6 }; 7 8 nodes.machine = { ... }: { 9 imports = [ 10 ./common/user-account.nix 11 ]; 12 13 services.xserver.enable = true; 14 15 services.xserver.displayManager = { 16 lightdm.enable = true; 17 autoLogin = { 18 enable = true; 19 user = "alice"; 20 }; 21 }; 22 23 services.xserver.desktopManager.mate.enable = true; 24 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; 28 }; 29 30 enableOCR = true; 31 32 testScript = { 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 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") 65 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'") 70 machine.sleep(2) 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'") 76 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)') 81 82 with subtest("Open MATE terminal"): 83 machine.succeed("su - ${user.name} -c '${env} mate-terminal >&2 &'") 84 machine.wait_for_window("Terminal") 85 86 with subtest("Check if MATE has ever coredumped"): 87 machine.fail("coredumpctl --json=short | grep -E 'mate|marco|caja'") 88 machine.screenshot("screen") 89 ''; 90})