about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-11 20:23:41 +0000
committerGitHub <noreply@github.com>2019-11-11 20:23:41 +0000
commitdeb125271c5697d7be96952181ee8c32463ae0b6 (patch)
tree6ef70eedcff521360cdae46d005e4a504cb5a4a6 /nixos/tests
parentd73e94578f22c5e4c0e10144a6f38220bb527ba7 (diff)
parent4f2daa7b29591c569efcae87aaec0abad618e1b1 (diff)
downloadnixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar.gz
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar.bz2
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar.lz
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar.xz
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.tar.zst
nixlib-deb125271c5697d7be96952181ee8c32463ae0b6.zip
Merge pull request #73137 from worldofpeace/port-xmonad-test
nixosTests.xmonad: port to python
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/xmonad.nix32
1 files changed, 17 insertions, 15 deletions
diff --git a/nixos/tests/xmonad.nix b/nixos/tests/xmonad.nix
index 79c15ccffecd..c2e5ba60d7bc 100644
--- a/nixos/tests/xmonad.nix
+++ b/nixos/tests/xmonad.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, ...} : {
+import ./make-test-python.nix ({ pkgs, ...} : {
   name = "xmonad";
   meta = with pkgs.stdenv.lib.maintainers; {
     maintainers = [ nequissimus ];
@@ -21,19 +21,21 @@ import ./make-test.nix ({ pkgs, ...} : {
     };
   };
 
-  testScript = { ... }: ''
-    $machine->waitForX;
-    $machine->waitForFile("/home/alice/.Xauthority");
-    $machine->succeed("xauth merge ~alice/.Xauthority");
-    $machine->sendKeys("alt-ctrl-x");
-    $machine->waitForWindow(qr/alice.*machine/);
-    $machine->sleep(1);
-    $machine->screenshot("terminal");
-    $machine->waitUntilSucceeds("xmonad --restart");
-    $machine->sleep(3);
-    $machine->sendKeys("alt-shift-ret");
-    $machine->waitForWindow(qr/alice.*machine/);
-    $machine->sleep(1);
-    $machine->screenshot("terminal");
+  testScript = { nodes, ... }: let
+    user = nodes.machine.config.users.users.alice;
+  in ''
+    machine.wait_for_x()
+    machine.wait_for_file("${user.home}/.Xauthority")
+    machine.succeed("xauth merge ${user.home}/.Xauthority")
+    machine.send_chars("alt-ctrl-x")
+    machine.wait_for_window("${user.name}.*machine")
+    machine.sleep(1)
+    machine.screenshot("terminal")
+    machine.wait_until_succeeds("xmonad --restart")
+    machine.sleep(3)
+    machine.send_chars("alt-shift-ret")
+    machine.wait_for_window("${user.name}.*machine")
+    machine.sleep(1)
+    machine.screenshot("terminal")
   '';
 })