2019-11-09 19:09:51 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
2018-01-10 01:52:15 +01:00
|
|
|
name = "deluge";
|
2021-01-10 20:08:30 +01:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2018-01-10 01:52:15 +01:00
|
|
|
maintainers = [ flokli ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
2021-11-05 10:44:25 +01:00
|
|
|
simple = {
|
2020-03-19 03:19:26 +01:00
|
|
|
services.deluge = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.deluge-2_x;
|
|
|
|
web = {
|
2018-01-10 01:52:15 +01:00
|
|
|
enable = true;
|
2019-03-29 15:51:07 +01:00
|
|
|
openFirewall = true;
|
2018-01-10 01:52:15 +01:00
|
|
|
};
|
|
|
|
};
|
2020-03-19 03:19:26 +01:00
|
|
|
};
|
|
|
|
|
2021-11-05 10:44:25 +01:00
|
|
|
declarative = {
|
2020-03-19 03:19:26 +01:00
|
|
|
services.deluge = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.deluge-2_x;
|
|
|
|
openFirewall = true;
|
|
|
|
declarative = true;
|
|
|
|
config = {
|
|
|
|
allow_remote = true;
|
|
|
|
download_location = "/var/lib/deluge/my-download";
|
|
|
|
daemon_port = 58846;
|
|
|
|
listen_ports = [ 6881 6889 ];
|
|
|
|
};
|
|
|
|
web = {
|
|
|
|
enable = true;
|
|
|
|
port = 3142;
|
|
|
|
};
|
|
|
|
authFile = pkgs.writeText "deluge-auth" ''
|
|
|
|
localclient:a7bef72a890:10
|
|
|
|
andrew:password:10
|
|
|
|
user3:anotherpass:5
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2018-01-10 01:52:15 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-09 19:09:51 +01:00
|
|
|
start_all()
|
2018-01-10 01:52:15 +01:00
|
|
|
|
2021-11-05 10:44:25 +01:00
|
|
|
simple.wait_for_unit("deluged")
|
|
|
|
simple.wait_for_unit("delugeweb")
|
2022-06-11 14:22:53 +02:00
|
|
|
simple.wait_for_open_port(8112)
|
2021-11-05 10:44:25 +01:00
|
|
|
declarative.wait_for_unit("network.target")
|
|
|
|
declarative.wait_until_succeeds("curl --fail http://simple:8112")
|
2019-03-29 15:51:07 +01:00
|
|
|
|
2021-11-05 10:44:25 +01:00
|
|
|
declarative.wait_for_unit("deluged")
|
|
|
|
declarative.wait_for_unit("delugeweb")
|
|
|
|
declarative.wait_until_succeeds("curl --fail http://declarative:3142")
|
|
|
|
declarative.succeed(
|
2020-03-19 03:19:26 +01:00
|
|
|
"deluge-console 'connect 127.0.0.1:58846 andrew password; help' | grep -q 'rm.*Remove a torrent'"
|
2019-11-09 19:09:51 +01:00
|
|
|
)
|
2018-01-10 01:52:15 +01:00
|
|
|
'';
|
|
|
|
})
|