1import ./make-test.nix ({ pkgs, ...} :
2
3{
4 name = "plasma5";
5 meta = with pkgs.stdenv.lib.maintainers; {
6 maintainers = [ ttuegel ];
7 };
8
9 machine = { lib, ... }: {
10 imports = [ ./common/user-account.nix ];
11 services.xserver.enable = true;
12 services.xserver.displayManager.sddm.enable = true;
13 services.xserver.desktopManager.plasma5.enable = true;
14 services.xserver.desktopManager.default = "plasma5";
15 virtualisation.memorySize = 1024;
16
17 # fontconfig-penultimate-0.3.3 -> 0.3.4 broke OCR apparently, but no idea why.
18 nixpkgs.config.packageOverrides = superPkgs: {
19 fontconfig-penultimate = superPkgs.fontconfig-penultimate.override {
20 version = "0.3.3";
21 sha256 = "1z76jbkb0nhf4w7fy647yyayqr4q02fgk6w58k0yi700p0m3h4c9";
22 };
23 };
24 };
25
26 enableOCR = true;
27
28 testScript = { nodes, ... }: let
29 user = nodes.machine.config.users.extraUsers.alice;
30 xdo = "${pkgs.xdotool}/bin/xdotool";
31 in ''
32 startAll;
33
34 # Wait for display manager to start
35 $machine->waitForText(qr/${user.description}/);
36 $machine->screenshot("sddm");
37
38 # Log in
39 $machine->sendChars("${user.password}\n");
40 $machine->waitForFile("/home/alice/.Xauthority");
41 $machine->succeed("xauth merge ~alice/.Xauthority");
42
43 $machine->waitUntilSucceeds("pgrep plasmashell");
44 $machine->waitForWindow("^Desktop ");
45
46 # Check that logging in has given the user ownership of devices.
47 $machine->succeed("getfacl /dev/snd/timer | grep -q alice");
48
49 $machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'");
50 $machine->waitForWindow(" Dolphin");
51
52 $machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'");
53 $machine->waitForWindow("Konsole");
54
55 $machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'");
56 $machine->waitForWindow("Settings");
57
58 $machine->execute("${xdo} key Alt+F1 sleep 10");
59 $machine->screenshot("screen");
60 '';
61})