1 import ./make-test-python.nix ({ pkgs, ...} : {
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ aanderse flokli ];
9 services.nzbget.enable = true;
11 # provide some test settings
12 services.nzbget.settings = {
13 "MainDir" = "/var/lib/nzbget";
14 "DirectRename" = true;
16 "Server1.Name" = "this is a test";
19 # hack, don't add (unfree) unrar to nzbget's path,
20 # so we can run this test in CI
21 systemd.services.nzbget.path = pkgs.lib.mkForce [ pkgs.p7zip ];
25 testScript = { nodes, ... }: ''
28 server.wait_for_unit("nzbget.service")
29 server.wait_for_unit("network.target")
30 server.wait_for_open_port(6789)
31 assert "This file is part of nzbget" in server.succeed(
32 "curl -f -s -u nzbget:tegbzn6789 http://127.0.0.1:6789"
35 "${pkgs.nzbget}/bin/nzbget -n -o Control_iP=127.0.0.1 -o Control_port=6789 -o Control_password=tegbzn6789 -V"
38 config = server.succeed("${nodes.server.config.systemd.services.nzbget.serviceConfig.ExecStart} --printconfig")
40 # confirm the test settings are applied
41 assert 'MainDir = "/var/lib/nzbget"' in config
42 assert 'DirectRename = "yes"' in config
43 assert 'DiskSpace = "0"' in config
44 assert 'Server1.Name = "this is a test"' in config