From 49229a3e2d88c3db6f444a23932b5484c6c9e4da Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 12 Dec 2022 11:57:09 +0100 Subject: [PATCH] tests: fix broken unit file when clightning is disabled Previously, an incomplete clightning unit was always created because attr `clightning` was always defined in option attrset `systemd.services`. --- test/tests.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/tests.nix b/test/tests.nix index b0f9c69..92b7c39 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -53,12 +53,6 @@ let clboss.path = "${nbPkgs.clboss}/bin/clboss"; }; in map (plugin: pluginPkgs.${plugin}.path) enabled; - # Torified 'dig' subprocesses of clboss don't respond to SIGTERM and keep - # running for a long time when WAN is disabled, which prevents clightning units - # from stopping quickly. - # Set TimeoutStopSec for faster stopping. - systemd.services.clightning.serviceConfig.TimeoutStopSec = - mkIf config.services.clightning.plugins.clboss.enable "500ms"; tests.clightning-rest = cfg.clightning-rest.enable; @@ -140,6 +134,13 @@ let # Avoid timeout failures on slow CI nodes systemd.services.postgresql.serviceConfig.TimeoutStartSec = "5min"; } + (mkIf config.services.clightning.plugins.clboss.enable { + # Torified 'dig' subprocesses of clboss don't respond to SIGTERM and keep + # running for a long time when WAN is disabled, which prevents clightning units + # from stopping quickly. + # Set TimeoutStopSec for faster stopping. + systemd.services.clightning.serviceConfig.TimeoutStopSec = "500ms"; + }) (mkIf config.test.features.clightningPlugins { services.clightning.plugins = { clboss.enable = true;