nixpkgs/nixos/tests/syncthing-relay.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
683 B
Nix
Raw Normal View History

{ lib, pkgs, ... }:
{
name = "syncthing-relay";
meta.maintainers = with pkgs.lib.maintainers; [ ];
2018-11-17 15:02:00 +01:00
nodes.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;
2018-11-17 15:02:00 +01:00
};
};
2018-11-17 15:02:00 +01:00
testScript = ''
machine.wait_for_unit("syncthing-relay.service")
machine.wait_for_open_port(12345)
machine.wait_for_open_port(12346)
2019-11-25 00:36:37 -08:00
out = machine.succeed(
"curl -sSf http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
)
assert "nixos-test" in out
'';
}