1 import ./make-test-python.nix ({ pkgs, ... }:
3 rpcSecret = "supersecret";
4 rpc-listen-port = 6800;
8 method = "aria2.getVersion";
9 params = [ "token:${rpcSecret}" ];
16 environment.etc."aria2Rpc".text = rpcSecret;
19 rpcSecretFile = "/etc/aria2Rpc";
21 inherit rpc-listen-port;
22 allow-overwrite = false;
23 check-integrity = true;
24 console-log-level = "warn";
25 listen-port = [{ from = 20000; to = 20010; } { from = 22222; to = 22222; }];
26 max-concurrent-downloads = 50;
35 machine.wait_for_unit("aria2.service")
36 curl_cmd = 'curl --fail-with-body -X POST -H "Content-Type: application/json" \
37 -d \'${builtins.toJSON curlBody}\' http://localhost:${toString rpc-listen-port}/jsonrpc'
38 print(machine.wait_until_succeeds(curl_cmd, timeout=10))
42 meta.maintainers = [ pkgs.lib.maintainers.timhae ];