From c0dcb5c24ad1faa671c90c017ef9f9df88defd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Thu, 16 Feb 2023 23:48:02 -0300 Subject: [PATCH] nixos/tests/budgie: init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Federico Damián Schonborn --- nixos/tests/all-tests.nix | 1 + nixos/tests/budgie.nix | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 nixos/tests/budgie.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ff2549395a0b..95a737bc7618 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -111,6 +111,7 @@ in { btrbk-doas = handleTest ./btrbk-doas.nix {}; btrbk-no-timer = handleTest ./btrbk-no-timer.nix {}; btrbk-section-order = handleTest ./btrbk-section-order.nix {}; + budgie = handleTest ./budgie.nix {}; buildbot = handleTest ./buildbot.nix {}; buildkite-agents = handleTest ./buildkite-agents.nix {}; caddy = handleTest ./caddy.nix {}; diff --git a/nixos/tests/budgie.nix b/nixos/tests/budgie.nix new file mode 100644 index 000000000000..cd7fa74b4498 --- /dev/null +++ b/nixos/tests/budgie.nix @@ -0,0 +1,53 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: { + name = "budgie"; + + meta = with lib; { + maintainers = [ maintainers.federicoschonborn ]; + }; + + nodes.machine = { ... }: { + imports = [ + ./common/user-account.nix + ]; + + services.xserver.enable = true; + + services.xserver.displayManager = { + lightdm.enable = true; + autoLogin = { + enable = true; + user = "alice"; + }; + }; + + services.xserver.desktopManager.budgie.enable = true; + +users.users.alice.extraGroups = ["wheel"]; + }; + + testScript = { nodes, ... }: + let + user = nodes.machine.users.users.alice; + in + '' + with subtest("Wait for login"): + machine.wait_for_x() + 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"): + machine.wait_until_succeeds("pgrep budgie-daemon") + machine.wait_for_window("budgie-daemon") + machine.wait_until_succeeds("pgrep budgie-panel") + machine.wait_for_window("budgie-panel") + + with subtest("Open MATE terminal"): + machine.succeed("su - ${user.name} -c 'DISPLAY=:0 mate-terminal >&2 &'") + machine.wait_for_window("Terminal") + machine.sleep(20) + machine.screenshot("screen") + ''; +})