From 65d911d76c86b47ce77f049f4befe8fe6a4929b8 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Sat, 30 Nov 2024 01:51:11 +0100 Subject: [PATCH] add backup test for deluge --- modules/services/deluge.nix | 1 + test/services/deluge.nix | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/modules/services/deluge.nix b/modules/services/deluge.nix index 11256b1..2335d24 100644 --- a/modules/services/deluge.nix +++ b/modules/services/deluge.nix @@ -247,6 +247,7 @@ in description = '' Backup configuration. ''; + default = {}; type = lib.types.submodule { options = contracts.backup.mkRequester { user = "deluge"; diff --git a/test/services/deluge.nix b/test/services/deluge.nix index a82ba7a..f124e94 100644 --- a/test/services/deluge.nix +++ b/test/services/deluge.nix @@ -7,7 +7,7 @@ let testLib = pkgs.callPackage ../common.nix {}; - commonTestScript = lib.makeOverridable testLib.accessScript { + commonTestScript = testLib.mkScripts { inherit subdomain domain; hasSSL = { node, ... }: !(isNull node.config.shb.deluge.ssl); waitForServices = { ... }: [ @@ -134,7 +134,23 @@ in nodes.client = {}; - testScript = commonTestScript; + testScript = commonTestScript.access; + }; + + backup = pkgs.testers.runNixOSTest { + name = "deluge_backup"; + + nodes.server = { config, ... }: { + imports = [ + base + basic + (testLib.backup config.shb.deluge.backup) + ]; + }; + + nodes.client = {}; + + testScript = commonTestScript.backup; }; https = pkgs.testers.runNixOSTest { @@ -151,7 +167,7 @@ in nodes.client = {}; - testScript = commonTestScript; + testScript = commonTestScript.access; }; sso = pkgs.testers.runNixOSTest { @@ -171,7 +187,7 @@ in nodes.client = {}; - testScript = commonTestScript.override { + testScript = commonTestScript.access.override { redirectSSO = true; }; }; @@ -192,7 +208,7 @@ in nodes.client = {}; testScript = inputs: - (commonTestScript inputs) + (commonTestScript.access inputs) + (prometheusTestScript inputs); }; }