1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 meta.maintainers = lib.teams.mate.members;
6 nodes.machine = { ... }: {
8 ./common/user-account.nix
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";
21 services.xserver.desktopManager.mate.enableWaylandSession = true;
23 # Need to switch to a different GPU driver than the default one (-vga std) so that wayfire can launch:
24 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
29 testScript = { nodes, ... }:
31 user = nodes.machine.users.users.alice;
34 machine.wait_for_unit("display-manager.service")
36 with subtest("Wait for Wayland server"):
37 machine.wait_for_file("/run/user/${toString user.uid}/wayland-1")
39 with subtest("Check if MATE session components actually start"):
40 for i in ["wayfire", "mate-panel", "mate-wayland.sh", "mate-wayland-components.sh"]:
41 machine.wait_until_succeeds(f"pgrep -f {i}")
42 # It is expected that this applet doesn't work in Wayland
43 machine.wait_for_text('WorkspaceSwitcherApplet')
45 with subtest("Check if various environment variables are set"):
46 cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf mate-panel)/environ"
47 machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'")
48 machine.succeed(f"{cmd} | grep 'XDG_SESSION_DESKTOP' | grep 'MATE'")
49 machine.succeed(f"{cmd} | grep 'MATE_PANEL_APPLETS_DIR' | grep '${pkgs.mate.mate-panel-with-applets.pname}'")
51 with subtest("Check if Wayfire config is properly configured"):
52 for i in ["button_style = mate", "firedecor", "mate-wayland-components.sh"]:
53 machine.wait_until_succeeds(f"cat /home/${user.name}/.config/mate/wayfire.ini | grep '{i}'")
55 with subtest("Check if Wayfire has ever coredumped"):
56 machine.fail("coredumpctl --json=short | grep wayfire")
58 machine.screenshot("screen")