diff options
author | Andrew Dunham <andrew@du.nham.ca> | 2019-11-25 00:36:37 -0800 |
---|---|---|
committer | Andrew Dunham <andrew@du.nham.ca> | 2019-11-25 00:36:37 -0800 |
commit | 7398211601c6120b47b22f72cd1b6b7e8e7e41ad (patch) | |
tree | 719dcf906fec42cf4c7c2ee88521752ee2e527fc /nixos/tests/syncthing-relay.nix | |
parent | 6e38def213c9d3fc4f9cb7062c6ee580ef07f913 (diff) |
nixosTests.syncthing*: port to python
Diffstat (limited to 'nixos/tests/syncthing-relay.nix')
-rw-r--r-- | nixos/tests/syncthing-relay.nix | 14 |
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 ''; }) |