1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 08:01:14 +00:00
nixpkgs/nixos/tests/syncthing-relay.nix

27 lines
723 B
Nix
Raw Normal View History

2019-11-25 08:36:37 +00:00
import ./make-test-python.nix ({ lib, pkgs, ... }: {
2018-11-17 14:02:00 +00:00
name = "syncthing-relay";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ];
machine = {
environment.systemPackages = [ pkgs.jq ];
services.syncthing.relay = {
enable = true;
providedBy = "nixos-test";
pools = []; # Don't connect to any pool while testing.
port = 12345;
statusPort = 12346;
};
};
testScript = ''
2019-11-25 08:36:37 +00:00
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
2018-11-17 14:02:00 +00:00
'';
})