summary refs log tree commit diff
path: root/nixos/tests/sddm.nix
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-06 20:55:18 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-11-09 15:20:20 -0500
commitb2fc25fe3c7243effb6cebbbac5b762990492339 (patch)
tree498d2514878803242cda88fe458f0091ec5310c8 /nixos/tests/sddm.nix
parent8a7b4ccd1fb03febc9463698f44402d3f0b26c4b (diff)
downloadnixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar.gz
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar.bz2
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar.lz
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar.xz
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.tar.zst
nixpkgs-b2fc25fe3c7243effb6cebbbac5b762990492339.zip
nixosTests.sddm: port to python
Diffstat (limited to 'nixos/tests/sddm.nix')
-rw-r--r--nixos/tests/sddm.nix28
1 files changed, 15 insertions, 13 deletions
diff --git a/nixos/tests/sddm.nix b/nixos/tests/sddm.nix
index 678bcbeab20..11d60598445 100644
--- a/nixos/tests/sddm.nix
+++ b/nixos/tests/sddm.nix
@@ -3,7 +3,7 @@
   pkgs ? import ../.. { inherit system config; }
 }:
 
-with import ../lib/testing.nix { inherit system pkgs; };
+with import ../lib/testing-python.nix { inherit system pkgs; };
 
 let
   inherit (pkgs) lib;
@@ -26,13 +26,13 @@ let
       testScript = { nodes, ... }: let
         user = nodes.machine.config.users.users.alice;
       in ''
-        startAll;
-        $machine->waitForText(qr/select your user/i);
-        $machine->screenshot("sddm");
-        $machine->sendChars("${user.password}\n");
-        $machine->waitForFile("/home/alice/.Xauthority");
-        $machine->succeed("xauth merge ~alice/.Xauthority");
-        $machine->waitForWindow("^IceWM ");
+        start_all()
+        machine.wait_for_text("select your user")
+        machine.screenshot("sddm")
+        machine.send_chars("${user.password}\n")
+        machine.wait_for_file("${user.home}/.Xauthority")
+        machine.succeed("xauth merge ${user.home}/.Xauthority")
+        machine.wait_for_window("^IceWM ")
       '';
     };
 
@@ -57,11 +57,13 @@ let
         services.xserver.desktopManager.default = "none";
       };
 
-      testScript = { ... }: ''
-        startAll;
-        $machine->waitForFile("/home/alice/.Xauthority");
-        $machine->succeed("xauth merge ~alice/.Xauthority");
-        $machine->waitForWindow("^IceWM ");
+      testScript = { nodes, ... }: let
+        user = nodes.machine.config.users.users.alice;
+      in ''
+        start_all()
+        machine.wait_for_file("${user.home}/.Xauthority")
+        machine.succeed("xauth merge ${user.home}/.Xauthority")
+        machine.wait_for_window("^IceWM ")
       '';
     };
   };