2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} :
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "plasma5";
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ ttuegel ];
|
|
|
|
};
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = { ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
|
|
|
services.xserver.displayManager.sddm.enable = true;
|
2021-10-17 02:12:59 +00:00
|
|
|
services.xserver.displayManager.defaultSession = "plasma";
|
2023-07-15 17:15:38 +00:00
|
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
|
|
|
environment.plasma5.excludePackages = [ pkgs.plasma5Packages.elisa ];
|
2020-07-18 16:06:22 +00:00
|
|
|
services.xserver.displayManager.autoLogin = {
|
2020-04-24 23:36:52 +00:00
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
|
|
|
hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = { nodes, ... }: let
|
2023-07-15 17:15:38 +00:00
|
|
|
user = nodes.machine.users.users.alice;
|
2020-04-24 23:36:52 +00:00
|
|
|
xdo = "${pkgs.xdotool}/bin/xdotool";
|
|
|
|
in ''
|
|
|
|
with subtest("Wait for login"):
|
|
|
|
start_all()
|
2023-07-15 17:15:38 +00:00
|
|
|
machine.wait_for_file("/tmp/xauth_*")
|
|
|
|
machine.succeed("xauth merge /tmp/xauth_*")
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with subtest("Check plasmashell started"):
|
|
|
|
machine.wait_until_succeeds("pgrep plasmashell")
|
|
|
|
machine.wait_for_window("^Desktop ")
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
with subtest("Check that KDED is running"):
|
|
|
|
machine.succeed("pgrep kded5")
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
with subtest("Check that logging in has given the user ownership of devices"):
|
|
|
|
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
with subtest("Ensure Elisa is not installed"):
|
|
|
|
machine.fail("which elisa")
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
machine.succeed("su - ${user.name} -c 'xauth merge /tmp/xauth_*'")
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
with subtest("Run Dolphin"):
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.wait_for_window(" Dolphin")
|
|
|
|
|
|
|
|
with subtest("Run Konsole"):
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.wait_for_window("Konsole")
|
|
|
|
|
|
|
|
with subtest("Run systemsettings"):
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.wait_for_window("Settings")
|
|
|
|
|
|
|
|
with subtest("Wait to get a screenshot"):
|
|
|
|
machine.execute(
|
|
|
|
"${xdo} key Alt+F1 sleep 10"
|
|
|
|
)
|
|
|
|
machine.screenshot("screen")
|
|
|
|
'';
|
|
|
|
})
|