lightningd/plugin_control: don't control non-dynamic plugins

This commit is contained in:
darosior
2019-07-18 15:32:48 +02:00
committed by Rusty Russell
parent 12e28c2554
commit 307fb0708e
3 changed files with 36 additions and 0 deletions

View File

@@ -130,6 +130,13 @@ def test_plugin_command(node_factory):
cmd = [hlp for hlp in n.rpc.help()["help"] if "hello" in hlp["command"]]
assert(len(cmd) == 0)
# Test that we cannot stop a plugin with 'dynamic' set to False in
# getmanifest
n.rpc.plugin_start(plugin=os.path.join(os.getcwd(), "tests/plugins/static.py"))
n.daemon.wait_for_log(r"Static plugin initialized.")
with pytest.raises(RpcError, match=r"plugin cannot be managed when lightningd is up"):
n.rpc.plugin_stop(plugin="static.py")
def test_plugin_disable(node_factory):
"""--disable-plugin works"""