at 23.11-beta 723 B view raw
1import ./make-test-python.nix ({ lib, pkgs, ... }: { 2 name = "syncthing-relay"; 3 meta.maintainers = with pkgs.lib.maintainers; [ delroth ]; 4 5 nodes.machine = { 6 environment.systemPackages = [ pkgs.jq ]; 7 services.syncthing.relay = { 8 enable = true; 9 providedBy = "nixos-test"; 10 pools = []; # Don't connect to any pool while testing. 11 port = 12345; 12 statusPort = 12346; 13 }; 14 }; 15 16 testScript = '' 17 machine.wait_for_unit("syncthing-relay.service") 18 machine.wait_for_open_port(12345) 19 machine.wait_for_open_port(12346) 20 21 out = machine.succeed( 22 "curl -sSf http://localhost:12346/status | jq -r '.options.\"provided-by\"'" 23 ) 24 assert "nixos-test" in out 25 ''; 26})