about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-06 21:18:26 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-11-09 15:24:41 -0500
commit4f2daa7b29591c569efcae87aaec0abad618e1b1 (patch)
tree174bc25b09a64f6c320282c17e4d3b8804a4eb29 /nixos
parent8a7b4ccd1fb03febc9463698f44402d3f0b26c4b (diff)
downloadnixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar.gz
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar.bz2
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar.lz
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar.xz
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.tar.zst
nixlib-4f2daa7b29591c569efcae87aaec0abad618e1b1.zip
nixosTests.xmonad: port to python
Diffstat (limited to 'nixos')
-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")
   '';
 })