2023-02-17 03:48:02 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
|
|
|
name = "budgie";
|
|
|
|
|
2024-03-14 05:28:41 +01:00
|
|
|
meta.maintainers = lib.teams.budgie.members;
|
2023-02-17 03:48:02 +01:00
|
|
|
|
|
|
|
nodes.machine = { ... }: {
|
|
|
|
imports = [
|
|
|
|
./common/user-account.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
|
|
|
services.xserver.displayManager = {
|
|
|
|
lightdm.enable = true;
|
|
|
|
autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-10 15:33:34 +02:00
|
|
|
# We don't ship gnome-text-editor in Budgie module, we add this line mainly
|
|
|
|
# to catch eval issues related to this option.
|
|
|
|
environment.budgie.excludePackages = [ pkgs.gnome-text-editor ];
|
|
|
|
|
2023-04-22 02:32:01 +02:00
|
|
|
services.xserver.desktopManager.budgie = {
|
|
|
|
enable = true;
|
|
|
|
extraPlugins = [
|
2023-05-12 01:45:45 +02:00
|
|
|
pkgs.budgiePlugins.budgie-analogue-clock-applet
|
2023-04-22 02:32:01 +02:00
|
|
|
];
|
|
|
|
};
|
2023-02-17 03:48:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = { nodes, ... }:
|
|
|
|
let
|
|
|
|
user = nodes.machine.users.users.alice;
|
2024-03-16 05:45:47 +01:00
|
|
|
env = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus DISPLAY=:0";
|
|
|
|
su = command: "su - ${user.name} -c '${env} ${command}'";
|
2023-02-17 03:48:02 +01:00
|
|
|
in
|
|
|
|
''
|
|
|
|
with subtest("Wait for login"):
|
2023-08-02 10:56:26 +02:00
|
|
|
# wait_for_x() checks graphical-session.target, which is expected to be
|
2024-01-28 09:10:44 +01:00
|
|
|
# inactive on Budgie before Budgie manages user session with systemd.
|
|
|
|
# https://github.com/BuddiesOfBudgie/budgie-desktop/blob/39e9f0895c978f76/src/session/budgie-desktop.in#L16
|
2023-08-02 10:56:26 +02:00
|
|
|
#
|
|
|
|
# Previously this was unconditionally touched by xsessionWrapper but was
|
|
|
|
# changed in #233981 (we have Budgie:GNOME in XDG_CURRENT_DESKTOP).
|
|
|
|
# machine.wait_for_x()
|
2024-01-28 09:10:44 +01:00
|
|
|
machine.wait_until_succeeds('journalctl -t budgie-session-binary --grep "Entering running state"')
|
2023-02-17 03:48:02 +01:00
|
|
|
machine.wait_for_file("${user.home}/.Xauthority")
|
|
|
|
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
|
|
|
|
|
|
|
with subtest("Check that logging in has given the user ownership of devices"):
|
|
|
|
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
|
|
|
|
|
|
|
with subtest("Check if Budgie session components actually start"):
|
2024-03-16 05:45:47 +01:00
|
|
|
for i in ["budgie-daemon", "budgie-panel", "budgie-wm", "budgie-desktop-view", "gsd-media-keys"]:
|
|
|
|
machine.wait_until_succeeds(f"pgrep -f {i}")
|
|
|
|
# We don't check xwininfo for budgie-wm.
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/216737#discussion_r1155312754
|
2023-02-17 03:48:02 +01:00
|
|
|
machine.wait_for_window("budgie-daemon")
|
|
|
|
machine.wait_for_window("budgie-panel")
|
2024-03-16 05:45:47 +01:00
|
|
|
|
|
|
|
with subtest("Check if various environment variables are set"):
|
|
|
|
cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf /run/current-system/sw/bin/budgie-wm)/environ"
|
|
|
|
machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Budgie:GNOME'")
|
2024-07-13 00:50:03 +02:00
|
|
|
machine.succeed(f"{cmd} | grep 'BUDGIE_PLUGIN_DATADIR' | grep '${pkgs.budgie-desktop-with-plugins.pname}'")
|
2024-03-16 05:45:47 +01:00
|
|
|
|
2024-03-19 16:59:56 +01:00
|
|
|
with subtest("Open run dialog"):
|
2024-03-16 05:45:47 +01:00
|
|
|
machine.send_key("alt-f2")
|
|
|
|
machine.wait_for_window("budgie-run-dialog")
|
2024-03-19 16:59:56 +01:00
|
|
|
machine.sleep(2)
|
|
|
|
machine.screenshot("run_dialog")
|
|
|
|
machine.send_key("esc")
|
|
|
|
|
|
|
|
with subtest("Open Budgie Control Center"):
|
|
|
|
machine.succeed("${su "budgie-control-center >&2 &"}")
|
2024-03-16 05:45:47 +01:00
|
|
|
machine.wait_for_window("Budgie Control Center")
|
|
|
|
|
|
|
|
with subtest("Lock the screen"):
|
|
|
|
machine.succeed("${su "budgie-screensaver-command -l >&2 &"}")
|
|
|
|
machine.wait_until_succeeds("${su "budgie-screensaver-command -q"} | grep 'The screensaver is active'")
|
|
|
|
machine.sleep(2)
|
|
|
|
machine.send_chars("${user.password}", delay=0.5)
|
|
|
|
machine.screenshot("budgie_screensaver")
|
|
|
|
machine.send_chars("\n")
|
|
|
|
machine.wait_until_succeeds("${su "budgie-screensaver-command -q"} | grep 'The screensaver is inactive'")
|
|
|
|
machine.sleep(2)
|
2023-02-17 03:48:02 +01:00
|
|
|
|
2024-03-21 14:04:08 +01:00
|
|
|
with subtest("Open GNOME terminal"):
|
|
|
|
machine.succeed("${su "gnome-terminal"}")
|
|
|
|
machine.wait_for_window("${user.name}@machine: ~")
|
2023-08-16 17:06:50 +02:00
|
|
|
|
2024-03-16 05:45:47 +01:00
|
|
|
with subtest("Check if Budgie has ever coredumped"):
|
|
|
|
machine.fail("coredumpctl --json=short | grep budgie")
|
|
|
|
machine.sleep(10)
|
2023-02-17 03:48:02 +01:00
|
|
|
machine.screenshot("screen")
|
|
|
|
'';
|
|
|
|
})
|