1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 meta.maintainers = lib.teams.cinnamon.members;
6 nodes.machine = { ... }: {
7 imports = [ ./common/user-account.nix ];
8 services.xserver.enable = true;
9 services.xserver.desktopManager.cinnamon.enable = true;
11 # We don't ship gnome-text-editor in Cinnamon module, we add this line mainly
12 # to catch eval issues related to this option.
13 environment.cinnamon.excludePackages = [ pkgs.gnome-text-editor ];
15 # For the sessionPath subtest.
16 services.xserver.desktopManager.cinnamon.sessionPath = [ pkgs.gpaste ];
21 testScript = { nodes, ... }:
23 user = nodes.machine.users.users.alice;
24 env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus DISPLAY=:0";
25 su = command: "su - ${user.name} -c '${env} ${command}'";
27 # Call javascript in cinnamon (the shell), returns a tuple (success, output),
28 # where `success` is true if the dbus call was successful and `output` is what
29 # the javascript evaluates to.
30 eval = name: su "gdbus call --session -d org.Cinnamon -o /org/Cinnamon -m org.Cinnamon.Eval ${name}";
33 machine.wait_for_unit("display-manager.service")
35 with subtest("Test if we can see username in slick-greeter"):
36 machine.wait_for_text("${user.description}")
37 machine.screenshot("slick_greeter_lightdm")
39 with subtest("Login with slick-greeter"):
40 machine.send_chars("${user.password}\n")
42 machine.wait_for_file("${user.home}/.Xauthority")
43 machine.succeed("xauth merge ${user.home}/.Xauthority")
45 with subtest("Check that logging in has given the user ownership of devices"):
46 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
48 with subtest("Wait for the Cinnamon shell"):
49 # Correct output should be (true, '2')
50 # https://github.com/linuxmint/cinnamon/blob/5.4.0/js/ui/main.js#L183-L187
51 machine.wait_until_succeeds("${eval "Main.runState"} | grep -q 'true,..2'")
53 with subtest("Check if Cinnamon components actually start"):
54 for i in ["csd-media-keys", "cinnamon-killer-daemon", "xapp-sn-watcher", "nemo-desktop"]:
55 machine.wait_until_succeeds(f"pgrep -f {i}")
56 machine.wait_until_succeeds("journalctl -b --grep 'Loaded applet menu@cinnamon.org'")
57 machine.wait_until_succeeds("journalctl -b --grep 'calendar@cinnamon.org: Calendar events supported'")
59 with subtest("Check if sessionPath option actually works"):
60 machine.succeed("${eval "imports.gi.GIRepository.Repository.get_search_path\\(\\)"} | grep gpaste")
62 with subtest("Open Cinnamon Settings"):
63 machine.succeed("${su "cinnamon-settings themes >&2 &"}")
64 machine.wait_until_succeeds("${eval "global.display.focus_window.wm_class"} | grep -i 'cinnamon-settings'")
65 machine.wait_for_text('(Style|Appearance|Color)')
67 machine.screenshot("cinnamon_settings")
69 with subtest("Lock the screen"):
70 machine.succeed("${su "cinnamon-screensaver-command -l >&2 &"}")
71 machine.wait_until_succeeds("${su "cinnamon-screensaver-command -q"} | grep 'The screensaver is active'")
73 machine.screenshot("cinnamon_screensaver")
74 machine.send_chars("${user.password}\n", delay=0.2)
75 machine.wait_until_succeeds("${su "cinnamon-screensaver-command -q"} | grep 'The screensaver is inactive'")
78 with subtest("Open GNOME Terminal"):
79 machine.succeed("${su "gnome-terminal"}")
80 machine.wait_until_succeeds("${eval "global.display.focus_window.wm_class"} | grep -i 'gnome-terminal'")
83 with subtest("Open virtual keyboard"):
84 machine.succeed("${su "dbus-send --print-reply --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.ToggleKeyboard"}")
85 machine.wait_for_text('(Ctrl|Alt)')
87 machine.screenshot("cinnamon_virtual_keyboard")
89 with subtest("Check if Cinnamon has ever coredumped"):
90 machine.fail("coredumpctl --json=short | grep -E 'cinnamon|nemo'")