2019-11-07 01:39:42 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} :
|
2016-06-01 15:05:46 +00:00
|
|
|
|
|
|
|
{
|
2017-03-03 13:25:45 +00:00
|
|
|
name = "plasma5";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2015-12-11 13:08:07 +00:00
|
|
|
maintainers = [ ttuegel ];
|
|
|
|
};
|
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { ... }:
|
2019-11-07 01:39:42 +00:00
|
|
|
|
2018-06-21 12:52:54 +00:00
|
|
|
{
|
2015-12-11 13:08:07 +00:00
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
2024-02-27 20:28:05 +00:00
|
|
|
services.displayManager.sddm.enable = true;
|
|
|
|
services.displayManager.defaultSession = "plasma";
|
2023-07-09 15:12:27 +00:00
|
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
|
|
|
environment.plasma5.excludePackages = [ pkgs.plasma5Packages.elisa ];
|
2024-02-27 20:28:05 +00:00
|
|
|
services.displayManager.autoLogin = {
|
2018-10-28 19:11:17 +00:00
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
2019-09-10 02:17:18 +00:00
|
|
|
hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
|
2015-12-11 13:08:07 +00:00
|
|
|
};
|
|
|
|
|
2017-03-24 13:02:24 +00:00
|
|
|
testScript = { nodes, ... }: let
|
2023-07-09 15:12:27 +00:00
|
|
|
user = nodes.machine.users.users.alice;
|
2017-03-24 13:02:24 +00:00
|
|
|
xdo = "${pkgs.xdotool}/bin/xdotool";
|
|
|
|
in ''
|
2019-11-07 01:46:44 +00:00
|
|
|
with subtest("Wait for login"):
|
|
|
|
start_all()
|
2023-07-09 15:12:27 +00:00
|
|
|
machine.wait_for_file("/tmp/xauth_*")
|
|
|
|
machine.succeed("xauth merge /tmp/xauth_*")
|
2019-11-07 01:46:44 +00:00
|
|
|
|
|
|
|
with subtest("Check plasmashell started"):
|
|
|
|
machine.wait_until_succeeds("pgrep plasmashell")
|
|
|
|
machine.wait_for_window("^Desktop ")
|
|
|
|
|
2020-12-14 11:43:08 +00:00
|
|
|
with subtest("Check that KDED is running"):
|
|
|
|
machine.succeed("pgrep kded5")
|
|
|
|
|
2019-11-07 01:46:44 +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-06-12 14:48:09 +00:00
|
|
|
with subtest("Ensure Elisa is not installed"):
|
|
|
|
machine.fail("which elisa")
|
|
|
|
|
2023-07-09 15:12:27 +00:00
|
|
|
machine.succeed("su - ${user.name} -c 'xauth merge /tmp/xauth_*'")
|
|
|
|
|
2019-11-07 01:46:44 +00:00
|
|
|
with subtest("Run Dolphin"):
|
2021-11-06 20:41:45 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
|
2019-11-07 01:46:44 +00:00
|
|
|
machine.wait_for_window(" Dolphin")
|
|
|
|
|
|
|
|
with subtest("Run Konsole"):
|
2021-11-06 20:41:45 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
|
2019-11-07 01:46:44 +00:00
|
|
|
machine.wait_for_window("Konsole")
|
|
|
|
|
|
|
|
with subtest("Run systemsettings"):
|
2021-11-06 20:41:45 +00:00
|
|
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
|
2019-11-07 01:46:44 +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")
|
2015-12-11 13:08:07 +00:00
|
|
|
'';
|
|
|
|
})
|