about summary refs log tree commit diff
diff options
context:
space:
mode:
authorx123 <x123@users.noreply.github.com>2019-12-02 22:20:36 +0100
committerx123 <x123@users.noreply.github.com>2019-12-02 22:20:36 +0100
commit362e3771543ad07ba3368d5dd423efcdb7fbe00f (patch)
treef25e89818999d2f5cde0a5aa458f3aaa5b640749
parent5a3dcb531e3b860f17b799761f2881e6bfa20415 (diff)
downloadnixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar.gz
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar.bz2
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar.lz
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar.xz
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.tar.zst
nixlib-362e3771543ad07ba3368d5dd423efcdb7fbe00f.zip
nixos/tests/xrdp: port to python
-rw-r--r--nixos/tests/xrdp.nix36
1 files changed, 19 insertions, 17 deletions
diff --git a/nixos/tests/xrdp.nix b/nixos/tests/xrdp.nix
index 0106aefe8318..1aceeffb955d 100644
--- a/nixos/tests/xrdp.nix
+++ b/nixos/tests/xrdp.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, ...} : {
+import ./make-test-python.nix ({ pkgs, ...} : {
   name = "xrdp";
   meta = with pkgs.stdenv.lib.maintainers; {
     maintainers = [ volth ];
@@ -21,25 +21,27 @@ import ./make-test.nix ({ pkgs, ...} : {
     };
   };
 
-  testScript = { ... }: ''
-    startAll;
+  testScript = { nodes, ... }: let
+    user = nodes.client.config.users.users.alice;
+  in ''
+    start_all()
 
-    $client->waitForX;
-    $client->waitForFile("/home/alice/.Xauthority");
-    $client->succeed("xauth merge ~alice/.Xauthority");
+    client.wait_for_x()
+    client.wait_for_file("${user.home}/.Xauthority")
+    client.succeed("xauth merge ${user.home}/.Xauthority")
 
-    $client->sleep(5);
+    client.sleep(5)
 
-    $client->execute("xterm &");
-    $client->sleep(1);
-    $client->sendChars("xfreerdp /cert-tofu /w:640 /h:480 /v:127.0.0.1 /u:alice /p:foobar\n");
-    $client->sleep(5);
-    $client->screenshot("localrdp");
+    client.execute("xterm &")
+    client.sleep(1)
+    client.send_chars("xfreerdp /cert-tofu /w:640 /h:480 /v:127.0.0.1 /u:${user.name} /p:${user.password}\n")
+    client.sleep(5)
+    client.screenshot("localrdp")
 
-    $client->execute("xterm &");
-    $client->sleep(1);
-    $client->sendChars("xfreerdp /cert-tofu /w:640 /h:480 /v:server /u:alice /p:foobar\n");
-    $client->sleep(5);
-    $client->screenshot("remoterdp");
+    client.execute("xterm &")
+    client.sleep(1)
+    client.send_chars("xfreerdp /cert-tofu /w:640 /h:480 /v:server /u:${user.name} /p:${user.password}\n")
+    client.sleep(5)
+    client.screenshot("remoterdp")
   '';
 })