mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-01 03:24:41 +01:00
32d98f0a87
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).
20 lines
500 B
Python
Executable File
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()
|