summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-06 20:38:23 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-11-25 11:54:37 -0500
commite15c4e48a217544b7e543d2f9bb5f49ec71723b5 (patch)
treec3103237f7ef5c5214f4a2f1c7dfaffda6de5e22 /nixos
parentaa6fb602a036480f19701079508cdfb810305aa6 (diff)
downloadnixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar.gz
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar.bz2
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar.lz
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar.xz
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.tar.zst
nixpkgs-e15c4e48a217544b7e543d2f9bb5f49ec71723b5.zip
nixosTests.pantheon: port to python
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/pantheon.nix57
1 files changed, 29 insertions, 28 deletions
diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix
index 69963413484..398d7c8e731 100644
--- a/nixos/tests/pantheon.nix
+++ b/nixos/tests/pantheon.nix
@@ -1,9 +1,10 @@
-import ./make-test.nix ({ pkgs, ...} :
+import ./make-test-python.nix ({ pkgs, ...} :
 
 {
   name = "pantheon";
+
   meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ worldofpeace ];
+    maintainers = pkgs.pantheon.maintainers;
   };
 
   machine = { ... }:
@@ -23,35 +24,35 @@ import ./make-test.nix ({ pkgs, ...} :
     user = nodes.machine.config.users.users.alice;
   in ''
     # Wait for display manager to start
-    $machine->waitForUnit("display-manager.service");
+    machine.wait_for_unit("display-manager.service")
 
     # Test we can see username in elementary-greeter
-    $machine->waitForText(qr/${user.description}/);
-    $machine->screenshot("elementary_greeter_lightdm");
-
-    # Log in
-    $machine->sendChars("${user.password}\n");
-    $machine->waitForUnit("default.target","alice");
-    $machine->waitForFile("${user.home}/.Xauthority");
-    $machine->succeed("xauth merge ${user.home}/.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 -p /dev/snd/timer | grep -q alice");
+    machine.wait_for_text("${user.description}")
+    machine.screenshot("elementary_greeter_lightdm")
+
+    # Log in with elementary-greeter
+    machine.send_chars("${user.password}\n")
+    machine.wait_for_unit("default.target", "${user.name}")
+    machine_wait_for_x()
+    machine.wait_for_file("${user.home}/.Xauthority")
+    machine.succeed("xauth merge ${user.home}/.Xauthority")
+
+    # Check that logging in has given the user ownership of devices
+    machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
+
+    # TODO: DBus API could eliminate this?
+    # Check if pantheon-shell components actually start
+    machine.wait_until_succeeds("pgrep gala")
+    machine.wait_for_window("gala")
+    machine.wait_until_succeeds("pgrep wingpanel")
+    machine.wait_for_window("wingpanel")
+    machine.wait_until_succeeds("pgrep plank")
+    machine.wait_for_window("plank")
 
     # 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");
+    machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal &'")
+    machine.wait_for_window("io.elementary.terminal")
+    machine.sleep(20)
+    machine.screenshot("screen")
   '';
 })