about summary refs log tree commit diff
path: root/nixos/tests/syncthing-relay.nix
diff options
context:
space:
mode:
authorAndrew Dunham <andrew@du.nham.ca>2019-11-25 00:36:37 -0800
committerAndrew Dunham <andrew@du.nham.ca>2019-11-25 00:36:37 -0800
commit7398211601c6120b47b22f72cd1b6b7e8e7e41ad (patch)
tree719dcf906fec42cf4c7c2ee88521752ee2e527fc /nixos/tests/syncthing-relay.nix
parent6e38def213c9d3fc4f9cb7062c6ee580ef07f913 (diff)
nixosTests.syncthing*: port to python
Diffstat (limited to 'nixos/tests/syncthing-relay.nix')
-rw-r--r--nixos/tests/syncthing-relay.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/nixos/tests/syncthing-relay.nix b/nixos/tests/syncthing-relay.nix
index f1ceb49933374..cd72ef1cbe1de 100644
--- a/nixos/tests/syncthing-relay.nix
+++ b/nixos/tests/syncthing-relay.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ lib, pkgs, ... }: {
+import ./make-test-python.nix ({ lib, pkgs, ... }: {
   name = "syncthing-relay";
   meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ];
 
@@ -14,9 +14,13 @@ import ./make-test.nix ({ lib, pkgs, ... }: {
   };
 
   testScript = ''
-    $machine->waitForUnit("syncthing-relay.service");
-    $machine->waitForOpenPort(12345);
-    $machine->waitForOpenPort(12346);
-    $machine->succeed("curl http://localhost:12346/status | jq -r '.options.\"provided-by\"'") =~ /nixos-test/ or die;
+    machine.wait_for_unit("syncthing-relay.service")
+    machine.wait_for_open_port(12345)
+    machine.wait_for_open_port(12346)
+
+    out = machine.succeed(
+        "curl -sS http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
+    )
+    assert "nixos-test" in out
   '';
 })