2019-12-16 22:03:29 +01:00
|
|
|
import os
|
|
|
|
|
from pyln.testing.fixtures import * # noqa: F401,F403
|
|
|
|
|
|
|
|
|
|
plugin_path = os.path.join(os.path.dirname(__file__), "monitor.py")
|
|
|
|
|
|
|
|
|
|
|
2019-12-27 15:58:14 +01:00
|
|
|
def test_monitor_starts(node_factory):
|
2019-12-16 22:03:29 +01:00
|
|
|
l1 = node_factory.get_node()
|
|
|
|
|
# Test dynamically
|
|
|
|
|
l1.rpc.plugin_start(plugin_path)
|
|
|
|
|
l1.rpc.plugin_stop(plugin_path)
|
|
|
|
|
l1.rpc.plugin_start(plugin_path)
|
|
|
|
|
l1.stop()
|
|
|
|
|
# Then statically
|
|
|
|
|
l1.daemon.opts["plugin"] = plugin_path
|
|
|
|
|
l1.start()
|
2020-12-13 00:45:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_monitor(node_factory):
|
|
|
|
|
pluginopt = {'plugin': plugin_path}
|
|
|
|
|
l1, l2 = node_factory.line_graph(2, opts=pluginopt)
|
|
|
|
|
assert l1.rpc.monitor()
|