at 24.11-pre 2.4 kB view raw
1import ./make-test-python.nix ({ pkgs, lib, ... }: { 2 name = "mate-wayland"; 3 4 meta.maintainers = lib.teams.mate.members; 5 6 nodes.machine = { ... }: { 7 imports = [ 8 ./common/user-account.nix 9 ]; 10 11 services.xserver.enable = true; 12 services.displayManager = { 13 sddm.enable = true; # https://github.com/canonical/lightdm/issues/63 14 sddm.wayland.enable = true; 15 defaultSession = "MATE"; 16 autoLogin = { 17 enable = true; 18 user = "alice"; 19 }; 20 }; 21 services.xserver.desktopManager.mate.enableWaylandSession = true; 22 23 hardware.pulseaudio.enable = true; 24 25 # Need to switch to a different GPU driver than the default one (-vga std) so that wayfire can launch: 26 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ]; 27 }; 28 29 enableOCR = true; 30 31 testScript = { nodes, ... }: 32 let 33 user = nodes.machine.users.users.alice; 34 in 35 '' 36 machine.wait_for_unit("display-manager.service") 37 38 with subtest("Wait for Wayland server"): 39 machine.wait_for_file("/run/user/${toString user.uid}/wayland-1") 40 41 with subtest("Check if MATE session components actually start"): 42 for i in ["wayfire", "mate-panel", "mate-wayland.sh", "mate-wayland-components.sh"]: 43 machine.wait_until_succeeds(f"pgrep -f {i}") 44 machine.wait_for_text('(Applications|Places|System)') 45 # It is expected that this applet doesn't work in Wayland 46 machine.wait_for_text('WorkspaceSwitcherApplet') 47 48 with subtest("Check if various environment variables are set"): 49 cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf mate-panel)/environ" 50 machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'") 51 machine.succeed(f"{cmd} | grep 'XDG_SESSION_DESKTOP' | grep 'MATE'") 52 machine.succeed(f"{cmd} | grep 'MATE_PANEL_APPLETS_DIR' | grep '${pkgs.mate.mate-panel-with-applets.pname}'") 53 54 with subtest("Check if Wayfire config is properly configured"): 55 for i in ["button_style = mate", "firedecor", "mate-wayland-components.sh"]: 56 machine.wait_until_succeeds(f"cat /home/${user.name}/.config/mate/wayfire.ini | grep '{i}'") 57 58 with subtest("Check if Wayfire has ever coredumped"): 59 machine.fail("coredumpctl --json=short | grep wayfire") 60 machine.sleep(10) 61 machine.screenshot("screen") 62 ''; 63})