diff options
Diffstat (limited to 'nixos/tests/plasma5.nix')
-rw-r--r-- | nixos/tests/plasma5.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nixos/tests/plasma5.nix b/nixos/tests/plasma5.nix new file mode 100644 index 00000000000..f561fc8c3c4 --- /dev/null +++ b/nixos/tests/plasma5.nix @@ -0,0 +1,53 @@ +import ./make-test.nix ({ pkgs, ...} : + +{ + name = "plasma5"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ ttuegel ]; + }; + + machine = { lib, ... }: { + imports = [ ./common/user-account.nix ]; + services.xserver.enable = true; + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + services.xserver.desktopManager.default = "plasma5"; + virtualisation.memorySize = 1024; + }; + + enableOCR = true; + + testScript = { nodes, ... }: let + user = nodes.machine.config.users.extraUsers.alice; + xdo = "${pkgs.xdotool}/bin/xdotool"; + in '' + startAll; + + # Wait for display manager to start + $machine->waitForText(qr/${user.description}/); + $machine->screenshot("sddm"); + + # Log in + $machine->sendChars("${user.password}\n"); + $machine->waitForFile("/home/alice/.Xauthority"); + $machine->succeed("xauth merge ~alice/.Xauthority"); + + $machine->waitUntilSucceeds("pgrep plasmashell"); + $machine->waitForWindow("^Desktop "); + + # Check that logging in has given the user ownership of devices. + $machine->succeed("getfacl /dev/snd/timer | grep -q alice"); + + $machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'"); + $machine->waitForWindow(" Dolphin"); + + $machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'"); + $machine->waitForWindow("Konsole"); + + $machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'"); + $machine->waitForWindow("Settings"); + + $machine->execute("${xdo} key Alt+F1 sleep 10"); + $machine->screenshot("screen"); + ''; +}) |