nixpkgs/nixos/tests/plasma5.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.1 KiB
Nix
Raw Normal View History

import ./make-test-python.nix ({ pkgs, ...} :
{
2017-03-03 16:25:45 +03:00
name = "plasma5";
meta = with pkgs.lib.maintainers; {
maintainers = [ ttuegel ];
};
2022-03-21 02:15:30 +03:00
nodes.machine = { ... }:
{
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
2017-03-24 16:02:24 +03:00
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.defaultSession = "plasma";
services.xserver.desktopManager.plasma5 = {
enable = true;
excludePackages = [ pkgs.plasma5Packages.elisa ];
};
services.xserver.displayManager.autoLogin = {
enable = true;
user = "alice";
};
hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
};
2017-03-24 16:02:24 +03:00
testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice;
2017-03-24 16:02:24 +03:00
xdo = "${pkgs.xdotool}/bin/xdotool";
in ''
2019-11-07 04:46:44 +03:00
with subtest("Wait for login"):
start_all()
machine.wait_for_file("${user.home}/.Xauthority")
machine.succeed("xauth merge ${user.home}/.Xauthority")
with subtest("Check plasmashell started"):
machine.wait_until_succeeds("pgrep plasmashell")
machine.wait_for_window("^Desktop ")
with subtest("Check that KDED is running"):
machine.succeed("pgrep kded5")
2019-11-07 04:46:44 +03: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}")
with subtest("Ensure Elisa is not installed"):
machine.fail("which elisa")
2019-11-07 04:46:44 +03:00
with subtest("Run Dolphin"):
2021-11-06 23:41:45 +03:00
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin >&2 &'")
2019-11-07 04:46:44 +03:00
machine.wait_for_window(" Dolphin")
with subtest("Run Konsole"):
2021-11-06 23:41:45 +03:00
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole >&2 &'")
2019-11-07 04:46:44 +03:00
machine.wait_for_window("Konsole")
with subtest("Run systemsettings"):
2021-11-06 23:41:45 +03:00
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 >&2 &'")
2019-11-07 04:46:44 +03:00
machine.wait_for_window("Settings")
with subtest("Wait to get a screenshot"):
machine.execute(
"${xdo} key Alt+F1 sleep 10"
)
machine.screenshot("screen")
'';
})