listconfigs: add plugin field if config is for a plugin.

I chose the full path name, not just the basename.

Suggested-by: @SimonVrouwe
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-06-02 12:06:21 +09:30
parent 6275dd384c
commit 3ac949d4c3
7 changed files with 45 additions and 1 deletions

View File

@@ -2441,6 +2441,7 @@ def test_dynamic_args(node_factory):
assert l1.rpc.call("hello") == "Test arg parsing world"
assert l1.rpc.listconfigs('greeting')['configs']['greeting']['value_str'] == 'Test arg parsing'
assert l1.rpc.listconfigs('greeting')['configs']['greeting']['plugin'] == plugin_path
l1.rpc.plugin_stop(plugin_path)
assert 'greeting' not in l1.rpc.listconfigs()['configs']
@@ -4166,6 +4167,7 @@ def test_plugin_persist_option(node_factory):
c = l1.rpc.listconfigs('greeting')['configs']['greeting']
assert c['source'] == "cmdline"
assert c['value_str'] == "Static option"
assert c['plugin'] == plugin_path
l1.rpc.plugin_stop(plugin_path)
assert 'greeting' not in l1.rpc.listconfigs()['configs']
@@ -4174,6 +4176,7 @@ def test_plugin_persist_option(node_factory):
c = l1.rpc.listconfigs('greeting')['configs']['greeting']
assert c['source'] == "cmdline"
assert c['value_str'] == "Static option"
assert c['plugin'] == plugin_path
assert l1.rpc.call("hello") == "Static option world"
l1.rpc.plugin_stop(plugin_path)
assert 'greeting' not in l1.rpc.listconfigs()['configs']
@@ -4183,6 +4186,7 @@ def test_plugin_persist_option(node_factory):
c = l1.rpc.listconfigs('greeting')['configs']['greeting']
assert c['source'] == "pluginstart"
assert c['value_str'] == "Dynamic option"
assert c['plugin'] == plugin_path
assert l1.rpc.call("hello") == "Dynamic option world"
l1.rpc.plugin_stop(plugin_path)
assert 'greeting' not in l1.rpc.listconfigs()['configs']
@@ -4192,4 +4196,5 @@ def test_plugin_persist_option(node_factory):
c = l1.rpc.listconfigs('greeting')['configs']['greeting']
assert c['source'] == "cmdline"
assert c['value_str'] == "Static option"
assert c['plugin'] == plugin_path
assert l1.rpc.call("hello") == "Static option world"