mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-24 00:04:20 +01:00
lightningd: call shutdown plugin when we dynamic shutdown a single one.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
2063049559
commit
516c38a750
@@ -2550,3 +2550,25 @@ plugin.run()
|
||||
n.daemon.wait_for_log(r"Plugin changed, needs restart.")
|
||||
n.daemon.wait_for_log(r"test_restart_on_update 2")
|
||||
n.stop()
|
||||
|
||||
|
||||
def test_plugin_shutdown(node_factory):
|
||||
"""test 'shutdown' notification"""
|
||||
p = os.path.join(os.getcwd(), "tests/plugins/test_libplugin")
|
||||
l1 = node_factory.get_node(options={'plugin': p})
|
||||
|
||||
l1.rpc.plugin_stop(p)
|
||||
l1.daemon.wait_for_log(r"test_libplugin: shutdown called")
|
||||
# FIXME: clean this up!
|
||||
l1.daemon.wait_for_log(r"test_libplugin: Killing plugin: exited during normal operation")
|
||||
|
||||
# Now try timeout.
|
||||
l1.rpc.plugin_start(p, dont_shutdown=True)
|
||||
l1.rpc.plugin_stop(p)
|
||||
l1.daemon.wait_for_log(r"test_libplugin: shutdown called")
|
||||
l1.daemon.wait_for_log(r"test_libplugin: Timeout on shutdown: killing anyway")
|
||||
|
||||
# Now, should also shutdown on finish.
|
||||
l1.rpc.plugin_start(p)
|
||||
l1.rpc.stop()
|
||||
l1.daemon.wait_for_log(r"test_libplugin: shutdown called")
|
||||
|
||||
Reference in New Issue
Block a user