1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-01-22 14:45:27 +00:00

Merge pull request #33679 from flokli/deluge-module

Deluge: use mkEnableOption, add test
This commit is contained in:
Matthew Justin Bauer 2018-04-25 14:54:34 -05:00 committed by GitHub
commit e4d2d32a32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 12 deletions

View file

@ -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";
};
};

View file

@ -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 {};

29
nixos/tests/deluge.nix Normal file
View file

@ -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");
'';
})