aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/programs/aria2
diff options
context:
space:
mode:
authorJustin Lovinger <git@justinlovinger.com>2020-04-28 14:38:41 -0400
committerRobert Helgesson <robert@rycee.net>2020-05-03 13:21:52 +0200
commit1dd226fde7e50d6e7a6de5b9ceb3ef1a7808b056 (patch)
tree754d7db05e90b6901a9ca810d33f14dc048345a3 /tests/modules/programs/aria2
parentded327b9fc4a10bd77265a077a2880c1b5b87567 (diff)
aria2: add module
PR #1202
Diffstat (limited to 'tests/modules/programs/aria2')
-rw-r--r--tests/modules/programs/aria2/default.nix1
-rw-r--r--tests/modules/programs/aria2/settings.nix41
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/modules/programs/aria2/default.nix b/tests/modules/programs/aria2/default.nix
new file mode 100644
index 00000000000..2964841d098
--- /dev/null
+++ b/tests/modules/programs/aria2/default.nix
@@ -0,0 +1 @@
+{ aria2-settings = ./settings.nix; }
diff --git a/tests/modules/programs/aria2/settings.nix b/tests/modules/programs/aria2/settings.nix
new file mode 100644
index 00000000000..0b5a52d90c5
--- /dev/null
+++ b/tests/modules/programs/aria2/settings.nix
@@ -0,0 +1,41 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+{
+ config = {
+ programs.aria2 = {
+ enable = true;
+
+ settings = {
+ listen-port = 60000;
+ dht-listen-port = 60000;
+ seed-ratio = 1.0;
+ max-upload-limit = "50K";
+ ftp-pasv = true;
+ };
+
+ extraConfig = ''
+ # Extra aria2 configuration.
+ '';
+ };
+
+ nixpkgs.overlays =
+ [ (self: super: { aria2 = pkgs.writeScriptBin "dummy-aria2" ""; }) ];
+
+ nmt.script = ''
+ assertFileContent \
+ home-files/.config/aria2/aria2.conf \
+ ${
+ pkgs.writeText "aria2-expected-config.conf" ''
+ dht-listen-port=60000
+ ftp-pasv=true
+ listen-port=60000
+ max-upload-limit=50K
+ seed-ratio=1.000000
+ # Extra aria2 configuration.
+ ''
+ }
+ '';
+ };
+}