2018-11-17 15:18:34 +01:00
|
|
|
from fixtures import * # noqa: F401,F403
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
def test_option_passthrough(node_factory):
|
|
|
|
""" Ensure that registering options works.
|
|
|
|
|
|
|
|
First attempts without the plugin and then with the plugin.
|
|
|
|
"""
|
2018-11-16 15:37:02 +01:00
|
|
|
plugin_path = 'contrib/plugins/helloworld.py'
|
2018-11-17 15:18:34 +01:00
|
|
|
|
|
|
|
help_out = subprocess.check_output([
|
|
|
|
'lightningd/lightningd',
|
|
|
|
'--help'
|
|
|
|
]).decode('utf-8')
|
|
|
|
assert('--greeting' not in help_out)
|
|
|
|
|
|
|
|
help_out = subprocess.check_output([
|
|
|
|
'lightningd/lightningd',
|
|
|
|
'--plugin={}'.format(plugin_path),
|
|
|
|
'--help'
|
|
|
|
]).decode('utf-8')
|
|
|
|
assert('--greeting' in help_out)
|
|
|
|
|
|
|
|
# Now try to see if it gets accepted, would fail to start if the
|
|
|
|
# option didn't exist
|
|
|
|
n = node_factory.get_node(options={'plugin': plugin_path, 'greeting': 'Mars'})
|
|
|
|
n.stop()
|