diff options
author | Matthew Justin Bauer <mjbauer95@gmail.com> | 2018-04-25 14:54:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-25 14:54:34 -0500 |
commit | e4d2d32a32c2523dcab34200fce7f58196ab5c54 (patch) | |
tree | e01184ef46227de15078d892327b4a430da881d5 /nixos | |
parent | 160d9ed652a56c804b3aaa012c9dec2aafef42df (diff) | |
parent | fe840cd3339eba56855840630d22889ee1424bfb (diff) | |
download | nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar.gz nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar.bz2 nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar.lz nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar.xz nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.tar.zst nixlib-e4d2d32a32c2523dcab34200fce7f58196ab5c54.zip |
Merge pull request #33679 from flokli/deluge-module
Deluge: use mkEnableOption, add test
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/torrent/deluge.nix | 14 | ||||
-rw-r--r-- | nixos/release.nix | 1 | ||||
-rw-r--r-- | nixos/tests/deluge.nix | 29 |
3 files changed, 32 insertions, 12 deletions
diff --git a/nixos/modules/services/torrent/deluge.nix b/nixos/modules/services/torrent/deluge.nix index ec1e97f4125e..bff22cd13594 100644 --- a/nixos/modules/services/torrent/deluge.nix +++ b/nixos/modules/services/torrent/deluge.nix @@ -11,10 +11,7 @@ in { options = { services = { deluge = { - enable = mkOption { - default = false; - description = "Start the Deluge daemon"; - }; + enable = mkEnableOption "Deluge daemon"; openFilesLimit = mkOption { default = openFilesLimit; @@ -25,14 +22,7 @@ in { }; }; - deluge.web = { - enable = mkOption { - default = false; - description = '' - Start Deluge Web daemon. - ''; - }; - }; + deluge.web.enable = mkEnableOption "Deluge Web daemon"; }; }; diff --git a/nixos/release.nix b/nixos/release.nix index 5d3c3de08dac..2f779280e6b2 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -268,6 +268,7 @@ in rec { tests.containers-hosts = callTest tests/containers-hosts.nix {}; tests.containers-macvlans = callTest tests/containers-macvlans.nix {}; tests.couchdb = callTest tests/couchdb.nix {}; + tests.deluge = callTest tests/deluge.nix {}; tests.docker = callTestOnMatchingSystems ["x86_64-linux"] tests/docker.nix {}; tests.docker-tools = callTestOnMatchingSystems ["x86_64-linux"] tests/docker-tools.nix {}; tests.docker-tools-overlay = callTestOnMatchingSystems ["x86_64-linux"] tests/docker-tools-overlay.nix {}; diff --git a/nixos/tests/deluge.nix b/nixos/tests/deluge.nix new file mode 100644 index 000000000000..6119fd58447c --- /dev/null +++ b/nixos/tests/deluge.nix @@ -0,0 +1,29 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "deluge"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ flokli ]; + }; + + nodes = { + server = + { pkgs, config, ... }: + + { services.deluge = { + enable = true; + web.enable = true; + }; + networking.firewall.allowedTCPPorts = [ 8112 ]; + }; + + client = { }; + }; + + testScript = '' + startAll; + + $server->waitForUnit("deluged"); + $server->waitForUnit("delugeweb"); + $client->waitForUnit("network.target"); + $client->waitUntilSucceeds("curl --fail http://server:8112"); + ''; +}) |