diff options
author | Pierre Bourdon <delroth@gmail.com> | 2018-11-17 15:02:00 +0100 |
---|---|---|
committer | Pierre Bourdon <delroth@gmail.com> | 2018-11-19 01:09:54 +0100 |
commit | 08f24cadaa65c367dd6599d0d7b1260d915cf527 (patch) | |
tree | e64827c68fac3147d82f9dc8c0c65953f9a03070 /nixos/tests | |
parent | 47b3086bdf59a4df366550185863a149392d55fe (diff) | |
download | nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar.gz nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar.bz2 nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar.lz nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar.xz nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.tar.zst nixpkgs-08f24cadaa65c367dd6599d0d7b1260d915cf527.zip |
syncthing-relay module: init
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/syncthing-relay.nix | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ec7178ec9ca..0d5a747b5c5 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -193,6 +193,7 @@ in strongswan-swanctl = handleTest ./strongswan-swanctl.nix {}; sudo = handleTest ./sudo.nix {}; switchTest = handleTest ./switch-test.nix {}; + syncthing-relay = handleTest ./syncthing-relay.nix {}; systemd = handleTest ./systemd.nix {}; taskserver = handleTest ./taskserver.nix {}; tomcat = handleTest ./tomcat.nix {}; diff --git a/nixos/tests/syncthing-relay.nix b/nixos/tests/syncthing-relay.nix new file mode 100644 index 00000000000..f1ceb499333 --- /dev/null +++ b/nixos/tests/syncthing-relay.nix @@ -0,0 +1,22 @@ +import ./make-test.nix ({ lib, pkgs, ... }: { + 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 = '' + $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; + ''; +}) |