@@ -1,4 +1,4 @@
1−import ./make-test.nix ({ pkgs, ...} :
1+import ./make-test-python.nix ({ pkgs, ...} :
22
33{
44 name = "plasma5";
@@ -7,23 +7,11 @@ import ./make-test.nix ({ pkgs, ...} :
77 };
88
99 machine = { ... }:
10− let
11− sddm_theme = pkgs.stdenv.mkDerivation {
12− name = "breeze-ocr-theme";
13− phases = "buildPhase";
14− buildCommand = ''
15− mkdir -p $out/share/sddm/themes/
16− cp -r ${pkgs.plasma-workspace}/share/sddm/themes/breeze $out/share/sddm/themes/breeze-ocr-theme
17− chmod -R +w $out/share/sddm/themes/breeze-ocr-theme
18− printf "[General]\ntype=color\ncolor=#1d99f3\nbackground=\n" > $out/share/sddm/themes/breeze-ocr-theme/theme.conf
19− '';
20− };
21− in
10+
2211 {
2312 imports = [ ./common/user-account.nix ];
2413 services.xserver.enable = true;
2514 services.xserver.displayManager.sddm.enable = true;
26− services.xserver.displayManager.sddm.theme = "breeze-ocr-theme";
2715 services.xserver.desktopManager.plasma5.enable = true;
2816 services.xserver.desktopManager.default = "plasma5";
2917 services.xserver.displayManager.sddm.autoLogin = {
@@ -32,34 +20,40 @@ import ./make-test.nix ({ pkgs, ...} :
3220 };
3321 hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
3422 virtualisation.memorySize = 1024;
35− environment.systemPackages = [ sddm_theme ];
3623 };
3724
3825 testScript = { nodes, ... }: let
3926 user = nodes.machine.config.users.users.alice;
4027 xdo = "${pkgs.xdotool}/bin/xdotool";
4128 in ''
42− startAll;
43− # wait for log in
44− $machine->waitForFile("/home/alice/.Xauthority");
45− $machine->succeed("xauth merge ~alice/.Xauthority");
46−
47− $machine->waitUntilSucceeds("pgrep plasmashell");
48− $machine->waitForWindow("^Desktop ");
49−
50− # Check that logging in has given the user ownership of devices.
51− $machine->succeed("getfacl -p /dev/snd/timer | grep -q alice");
52−
53− $machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'");
54− $machine->waitForWindow(" Dolphin");
55−
56− $machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'");
57− $machine->waitForWindow("Konsole");
58−
59− $machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'");
60− $machine->waitForWindow("Settings");
61−
62− $machine->execute("${xdo} key Alt+F1 sleep 10");
63− $machine->screenshot("screen");
29+ with subtest("Wait for login"):
30+ start_all()
31+ machine.wait_for_file("${user.home}/.Xauthority")
32+ machine.succeed("xauth merge ${user.home}/.Xauthority")
33+
34+ with subtest("Check plasmashell started"):
35+ machine.wait_until_succeeds("pgrep plasmashell")
36+ machine.wait_for_window("^Desktop ")
37+
38+ with subtest("Check that logging in has given the user ownership of devices"):
39+ machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
40+
41+ with subtest("Run Dolphin"):
42+ machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin &'")
43+ machine.wait_for_window(" Dolphin")
44+
45+ with subtest("Run Konsole"):
46+ machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole &'")
47+ machine.wait_for_window("Konsole")
48+
49+ with subtest("Run systemsettings"):
50+ machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 &'")
51+ machine.wait_for_window("Settings")
52+
53+ with subtest("Wait to get a screenshot"):
54+ machine.execute(
55+ "${xdo} key Alt+F1 sleep 10"
56+ )
57+ machine.screenshot("screen")
6458 '';
6559})