core-lightning/tests/plugins/broken.py
darosior 32d98f0a87 plugins: refactor the tests for dynamic plugins
This adapts the test to the new 'plugin' command: no more sleeping,
since we are synchronous !

This tests the timeout by increasing the 'slowinit' plugin sleep
duration at init reception.

This adds a broken plugin to make sure we won't crash because of a
misbehaving plugin (unmet dependency is the most common case).
2019-09-30 00:20:16 +00:00

20 lines
500 B
Python
Executable File

#!/usr/bin/env python3
"""Simple plugin to test that lightningd doesnt crash if it starts a
misbehaving plugin via RPC.
"""
from lightning import Plugin
import an_unexistent_module_that_will_make_me_crash
plugin = Plugin(dynamic=False)
@plugin.init()
def init(options, configuration, plugin):
plugin.log("broken.py initializing {}".format(configuration))
# We need to actually use the import to pass source checks..
an_unexistent_module_that_will_make_me_crash.hello()
plugin.run()