mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
25bef2d8f9
The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs.
27 lines
717 B
Nix
27 lines
717 B
Nix
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
|
name = "syncthing-relay";
|
|
meta.maintainers = with pkgs.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 = ''
|
|
machine.wait_for_unit("syncthing-relay.service")
|
|
machine.wait_for_open_port(12345)
|
|
machine.wait_for_open_port(12346)
|
|
|
|
out = machine.succeed(
|
|
"curl -sSf http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
|
|
)
|
|
assert "nixos-test" in out
|
|
'';
|
|
})
|