1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "cinnamon-wayland";
4 meta.maintainers = lib.teams.cinnamon.members;
6 nodes.machine = { nodes, ... }: {
7 imports = [ ./common/user-account.nix ];
8 services.xserver.enable = true;
9 services.xserver.desktopManager.cinnamon.enable = true;
10 services.displayManager = {
11 autoLogin.enable = true;
12 autoLogin.user = nodes.machine.users.users.alice.name;
13 defaultSession = "cinnamon-wayland";
16 # For the sessionPath subtest.
17 services.xserver.desktopManager.cinnamon.sessionPath = [ pkgs.gnome.gpaste ];
22 testScript = { nodes, ... }:
24 user = nodes.machine.users.users.alice;
25 env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
26 su = command: "su - ${user.name} -c '${env} ${command}'";
28 # Call javascript in cinnamon (the shell), returns a tuple (success, output),
29 # where `success` is true if the dbus call was successful and `output` is what
30 # the javascript evaluates to.
31 eval = name: su "gdbus call --session -d org.Cinnamon -o /org/Cinnamon -m org.Cinnamon.Eval ${name}";
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-0")
39 with subtest("Check that logging in has given the user ownership of devices"):
40 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
42 with subtest("Wait for the Cinnamon shell"):
43 # Correct output should be (true, '2')
44 # https://github.com/linuxmint/cinnamon/blob/5.4.0/js/ui/main.js#L183-L187
45 machine.wait_until_succeeds("${eval "Main.runState"} | grep -q 'true,..2'")
47 with subtest("Check if Cinnamon components actually start"):
48 for i in ["csd-media-keys", "xapp-sn-watcher", "nemo-desktop"]:
49 machine.wait_until_succeeds(f"pgrep -f {i}")
50 machine.wait_until_succeeds("journalctl -b --grep 'Loaded applet menu@cinnamon.org'")
51 machine.wait_until_succeeds("journalctl -b --grep 'calendar@cinnamon.org: Calendar events supported'")
53 with subtest("Check if sessionPath option actually works"):
54 machine.succeed("${eval "imports.gi.GIRepository.Repository.get_search_path\\(\\)"} | grep gpaste")
56 with subtest("Open Cinnamon Settings"):
57 machine.succeed("${su "cinnamon-settings themes >&2 &"}")
58 machine.wait_until_succeeds("${eval "global.display.focus_window.wm_class"} | grep -i 'cinnamon-settings'")
59 machine.wait_for_text('(Style|Appearance|Color)')
61 machine.screenshot("cinnamon_settings")
63 with subtest("Check if screensaver works"):
64 # This is not supported at the moment.
65 # https://trello.com/b/HHs01Pab/cinnamon-wayland
66 machine.execute("${su "cinnamon-screensaver-command -l >&2 &"}")
67 machine.wait_until_succeeds("journalctl -b --grep 'cinnamon-screensaver is disabled in wayland sessions'")
69 with subtest("Open GNOME Terminal"):
70 machine.succeed("${su "dbus-launch gnome-terminal"}")
71 machine.wait_until_succeeds("${eval "global.display.focus_window.wm_class"} | grep -i 'gnome-terminal'")
74 with subtest("Check if Cinnamon has ever coredumped"):
75 machine.fail("coredumpctl --json=short | grep -E 'cinnamon|nemo'")