about summary refs log tree commit diff
path: root/nixos/tests/pantheon.nix
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@users.noreply.github.com>2018-08-20 16:31:18 -0400
committerworldofpeace <worldofpeace@users.noreply.github.com>2019-01-24 20:54:14 +0000
commit78da8d668b51b10d12285483a661307e1d3052eb (patch)
treef24edb95d698d3c240dd1359a0957ec776b94912 /nixos/tests/pantheon.nix
parent2530372351fb7c65df1e209356c5eabf5a66fa9e (diff)
pantheon: init a 5.0
Diffstat (limited to 'nixos/tests/pantheon.nix')
-rw-r--r--nixos/tests/pantheon.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix
new file mode 100644
index 0000000000000..c50f77f861732
--- /dev/null
+++ b/nixos/tests/pantheon.nix
@@ -0,0 +1,55 @@
+import ./make-test.nix ({ pkgs, ...} :
+
+{
+  name = "pantheon";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ worldofpeace ];
+  };
+
+  machine = { ... }:
+
+  {
+    imports = [ ./common/user-account.nix ];
+
+    services.xserver.enable = true;
+    services.xserver.desktopManager.pantheon.enable = true;
+
+    virtualisation.memorySize = 1024;
+  };
+
+  enableOCR = true;
+
+  testScript = { nodes, ... }: let
+    user = nodes.machine.config.users.users.alice;
+  in ''
+    startAll;
+
+    # Wait for display manager to start
+    $machine->waitForText(qr/${user.description}/);
+    $machine->screenshot("lightdm");
+
+    # Log in
+    $machine->sendChars("${user.password}\n");
+    $machine->waitForFile("/home/alice/.Xauthority");
+    $machine->succeed("xauth merge ~alice/.Xauthority");
+
+    # Check if "pantheon-shell" components actually start
+    $machine->waitUntilSucceeds("pgrep gala");
+    $machine->waitForWindow(qr/gala/);
+    $machine->waitUntilSucceeds("pgrep wingpanel");
+    $machine->waitForWindow("wingpanel");
+    $machine->waitUntilSucceeds("pgrep plank");
+    $machine->waitForWindow(qr/plank/);
+
+    # Check that logging in has given the user ownership of devices.
+    $machine->succeed("getfacl /dev/snd/timer | grep -q alice");
+
+    # Open elementary terminal
+    $machine->execute("su - alice -c 'DISPLAY=:0.0 io.elementary.terminal &'");
+    $machine->waitForWindow(qr/io.elementary.terminal/);
+
+    # Take a screenshot of the desktop
+    $machine->sleep(20);
+    $machine->screenshot("screen");
+  '';
+})