2021-09-22 13:59:09 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ...} :
|
2018-08-20 23:31:18 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "pantheon";
|
2019-11-07 04:38:23 +03:00
|
|
|
|
2023-04-30 04:17:05 +03:00
|
|
|
meta.maintainers = lib.teams.pantheon.members;
|
2018-08-20 23:31:18 +03:00
|
|
|
|
2022-03-21 02:15:30 +03:00
|
|
|
nodes.machine = { ... }:
|
2018-08-20 23:31:18 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.desktopManager.pantheon.enable = true;
|
|
|
|
|
2023-03-07 18:16:33 +03:00
|
|
|
environment.systemPackages = [ pkgs.xdotool ];
|
2018-08-20 23:31:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enableOCR = true;
|
|
|
|
|
|
|
|
testScript = { nodes, ... }: let
|
2023-01-21 18:41:23 +03:00
|
|
|
user = nodes.machine.users.users.alice;
|
|
|
|
bob = nodes.machine.users.users.bob;
|
2018-08-20 23:31:18 +03:00
|
|
|
in ''
|
2019-11-07 04:38:23 +03:00
|
|
|
machine.wait_for_unit("display-manager.service")
|
2019-11-07 04:20:16 +03:00
|
|
|
|
2019-11-25 20:03:51 +03:00
|
|
|
with subtest("Test we can see usernames in elementary-greeter"):
|
|
|
|
machine.wait_for_text("${user.description}")
|
2019-11-26 17:24:10 +03:00
|
|
|
# OCR was struggling with this one.
|
|
|
|
# machine.wait_for_text("${bob.description}")
|
2023-03-07 18:16:33 +03:00
|
|
|
# Ensure the password box is focused by clicking it.
|
|
|
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/211366.
|
|
|
|
machine.succeed("XAUTHORITY=/var/lib/lightdm/.Xauthority DISPLAY=:0 xdotool mousemove 512 505 click 1")
|
|
|
|
machine.sleep(2)
|
2019-11-25 20:03:51 +03:00
|
|
|
machine.screenshot("elementary_greeter_lightdm")
|
|
|
|
|
|
|
|
with subtest("Login with elementary-greeter"):
|
|
|
|
machine.send_chars("${user.password}\n")
|
|
|
|
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 pantheon session components actually start"):
|
|
|
|
machine.wait_until_succeeds("pgrep gala")
|
|
|
|
machine.wait_for_window("gala")
|
2021-07-19 11:49:52 +03:00
|
|
|
machine.wait_until_succeeds("pgrep -f io.elementary.wingpanel")
|
|
|
|
machine.wait_for_window("io.elementary.wingpanel")
|
2019-11-25 20:03:51 +03:00
|
|
|
machine.wait_until_succeeds("pgrep plank")
|
|
|
|
machine.wait_for_window("plank")
|
|
|
|
|
2023-01-21 18:23:51 +03:00
|
|
|
with subtest("Open system settings"):
|
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.switchboard >&2 &'")
|
|
|
|
# Wait for all plugins to be loaded before we check if the window is still there.
|
|
|
|
machine.sleep(5)
|
|
|
|
machine.wait_for_window("io.elementary.switchboard")
|
|
|
|
|
2019-11-25 20:03:51 +03:00
|
|
|
with subtest("Open elementary terminal"):
|
2021-11-05 23:13:36 +03:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal >&2 &'")
|
2019-11-25 20:03:51 +03:00
|
|
|
machine.wait_for_window("io.elementary.terminal")
|
2023-08-16 16:40:34 +03:00
|
|
|
|
|
|
|
with subtest("Check if gala has ever coredumped"):
|
|
|
|
machine.fail("coredumpctl --json=short | grep gala")
|
2019-11-25 20:03:51 +03:00
|
|
|
machine.sleep(20)
|
|
|
|
machine.screenshot("screen")
|
2018-08-20 23:31:18 +03:00
|
|
|
'';
|
|
|
|
})
|