From f9315db52c03263a0bf9be025d768864cd7beb3a Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 27 May 2022 11:13:53 +0200 Subject: [PATCH] clightning/feeadjuster: add test --- test/tests.nix | 1 + test/tests.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/test/tests.nix b/test/tests.nix index 7f3e420..77e367a 100644 --- a/test/tests.nix +++ b/test/tests.nix @@ -134,6 +134,7 @@ let (mkIf config.test.features.clightningPlugins { services.clightning.plugins = { clboss.enable = true; + feeadjuster.enable = true; helpme.enable = true; monitor.enable = true; prometheus.enable = true; diff --git a/test/tests.py b/test/tests.py index e1599ab..3b20aa1 100644 --- a/test/tests.py +++ b/test/tests.py @@ -127,20 +127,24 @@ def _(): def _(): assert_running("clightning") assert_matches("runuser -u operator -- lightning-cli getinfo | jq", '"id"') - if test_data["clightning-plugins"]: + + enabled_plugins = test_data["clightning-plugins"] + if enabled_plugins: plugin_list = succeed("lightning-cli plugin list") plugins = json.loads(plugin_list)["plugins"] active = set(plugin["name"] for plugin in plugins if plugin["active"]) - failed = set(test_data["clightning-plugins"]).difference(active) + failed = set(enabled_plugins).difference(active) if failed: raise Exception( f"The following clightning plugins are inactive:\n{failed}.\n\n" f"Output of 'lightning-cli plugin list':\n{plugin_list}" ) - else: - machine.log("Active clightning plugins:") - for p in test_data["clightning-plugins"]: - machine.log(os.path.basename(p)) + active = [os.path.splitext(os.path.basename(p))[0] for p in enabled_plugins] + machine.log("\n".join(["Active clightning plugins:", *active])) + + if "feeadjuster" in active: + # This is a one-shot service, so this command only succeeds if the service succeeds + succeed("systemctl start clightning-feeadjuster") @test("lnd") def _():