1 import ./make-test-python.nix (
5 name = "pantheon-wayland";
7 meta.maintainers = lib.teams.pantheon.members;
13 videosAutostart = pkgs.writeTextFile {
14 name = "autostart-elementary-videos";
15 destination = "/etc/xdg/autostart/io.elementary.videos.desktop";
22 Exec=io.elementary.videos %U
27 imports = [ ./common/user-account.nix ];
29 # Workaround ".gala-wrapped invoked oom-killer"
30 virtualisation.memorySize = 2047;
32 services.xserver.enable = true;
33 services.xserver.desktopManager.pantheon.enable = true;
34 services.displayManager = {
35 autoLogin.enable = true;
36 autoLogin.user = nodes.machine.users.users.alice.name;
37 defaultSession = "pantheon-wayland";
40 # We ship pantheon.appcenter by default when this is enabled.
41 services.flatpak.enable = true;
43 # For basic OCR tests.
44 environment.systemPackages = [ videosAutostart ];
46 # We don't ship gnome-text-editor in Pantheon module, we add this line mainly
47 # to catch eval issues related to this option.
48 environment.pantheon.excludePackages = [ pkgs.gnome-text-editor ];
56 user = nodes.machine.users.users.alice;
59 machine.wait_for_unit("display-manager.service")
61 with subtest("Wait for wayland server"):
62 machine.wait_for_file("/run/user/${toString user.uid}/wayland-0")
64 with subtest("Check that logging in has given the user ownership of devices"):
65 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
67 with subtest("Check if Pantheon components actually start"):
68 # We specifically check gsd-xsettings here since it is manually pulled up by gala.
69 # https://github.com/elementary/gala/pull/2140
70 for i in ["gala", "io.elementary.wingpanel", "io.elementary.dock", "gsd-media-keys", "gsd-xsettings", "io.elementary.desktop.agent-polkit"]:
71 machine.wait_until_succeeds(f"pgrep -f {i}")
72 for i in ["io.elementary.files.xdg-desktop-portal.service"]:
73 machine.wait_for_unit(i, "${user.name}")
75 with subtest("Check if various environment variables are set"):
76 cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf ${pkgs.pantheon.gala}/bin/gala)/environ"
77 machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'")
78 machine.succeed(f"{cmd} | grep 'XDG_SESSION_TYPE' | grep 'wayland'")
79 # Hopefully from the sessionPath option.
80 machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'")
81 # Hopefully from login shell.
82 machine.succeed(f"{cmd} | grep '__NIXOS_SET_ENVIRONMENT_DONE' | grep '1'")
84 with subtest("Wait for elementary videos autostart"):
85 machine.wait_until_succeeds("pgrep -f io.elementary.videos")
86 machine.wait_for_text("No Videos Open")
87 machine.screenshot("videos")
89 with subtest("Trigger multitasking view"):
90 cmd = "dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1"
91 env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus"
92 machine.succeed(f"su - ${user.name} -c '{env} {cmd}'")
94 machine.screenshot("multitasking")
95 machine.succeed(f"su - ${user.name} -c '{env} {cmd}'")
97 with subtest("Check if gala has ever coredumped"):
98 machine.fail("coredumpctl --json=short | grep gala")
99 # So we can see the dock.
100 machine.execute("pkill -f -9 io.elementary.videos")
102 machine.screenshot("screen")