1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 meta.maintainers = lib.teams.budgie.members;
6 nodes.machine = { ... }: {
8 ./common/user-account.nix
11 services.xserver.enable = true;
13 services.xserver.displayManager = {
14 lightdm.enable = true;
21 # We don't ship gnome-text-editor in Budgie module, we add this line mainly
22 # to catch eval issues related to this option.
23 environment.budgie.excludePackages = [ pkgs.gnome-text-editor ];
25 services.xserver.desktopManager.budgie = {
28 pkgs.budgie-analogue-clock-applet
33 testScript = { nodes, ... }:
35 user = nodes.machine.users.users.alice;
36 env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus DISPLAY=:0";
37 su = command: "su - ${user.name} -c '${env} ${command}'";
40 with subtest("Wait for login"):
41 # wait_for_x() checks graphical-session.target, which is expected to be
42 # inactive on Budgie before Budgie manages user session with systemd.
43 # https://github.com/BuddiesOfBudgie/budgie-desktop/blob/39e9f0895c978f76/src/session/budgie-desktop.in#L16
45 # Previously this was unconditionally touched by xsessionWrapper but was
46 # changed in #233981 (we have Budgie:GNOME in XDG_CURRENT_DESKTOP).
47 # machine.wait_for_x()
48 machine.wait_until_succeeds('journalctl -t budgie-session-binary --grep "Entering running state"')
49 machine.wait_for_file("${user.home}/.Xauthority")
50 machine.succeed("xauth merge ${user.home}/.Xauthority")
52 with subtest("Check that logging in has given the user ownership of devices"):
53 machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
55 with subtest("Check if Budgie session components actually start"):
56 for i in ["budgie-daemon", "budgie-panel", "budgie-wm", "budgie-desktop-view", "gsd-media-keys"]:
57 machine.wait_until_succeeds(f"pgrep -f {i}")
58 # We don't check xwininfo for budgie-wm.
59 # See https://github.com/NixOS/nixpkgs/pull/216737#discussion_r1155312754
60 machine.wait_for_window("budgie-daemon")
61 machine.wait_for_window("budgie-panel")
63 with subtest("Check if various environment variables are set"):
64 cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf /run/current-system/sw/bin/budgie-wm)/environ"
65 machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Budgie:GNOME'")
66 machine.succeed(f"{cmd} | grep 'BUDGIE_PLUGIN_DATADIR' | grep '${pkgs.budgie-desktop-with-plugins.pname}'")
68 with subtest("Open run dialog"):
69 machine.send_key("alt-f2")
70 machine.wait_for_window("budgie-run-dialog")
72 machine.screenshot("run_dialog")
73 machine.send_key("esc")
75 with subtest("Open Budgie Control Center"):
76 machine.succeed("${su "budgie-control-center >&2 &"}")
77 machine.wait_for_window("Budgie Control Center")
79 with subtest("Lock the screen"):
80 machine.succeed("${su "budgie-screensaver-command -l >&2 &"}")
81 machine.wait_until_succeeds("${su "budgie-screensaver-command -q"} | grep 'The screensaver is active'")
83 machine.send_chars("${user.password}", delay=0.5)
84 machine.screenshot("budgie_screensaver")
85 machine.send_chars("\n")
86 machine.wait_until_succeeds("${su "budgie-screensaver-command -q"} | grep 'The screensaver is inactive'")
89 with subtest("Open GNOME terminal"):
90 machine.succeed("${su "gnome-terminal"}")
91 machine.wait_for_window("${user.name}@machine: ~")
93 with subtest("Check if Budgie has ever coredumped"):
94 machine.fail("coredumpctl --json=short | grep budgie")
96 machine.screenshot("screen")