core-lightning/tests/plugins/badinterp.py
Rusty Russell bc36a4580c pytest: test (failing) for not crashing if plugin fails to exec via plugin startdir
It hits the new assert(): before that (tested!) it actually kills everything and logs you out.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-08-18 13:18:49 +09:30

16 lines
296 B
Python
Executable File

#!/some/bad/path/to/python3
from pyln.client import Plugin
import os
import time
plugin = Plugin()
@plugin.init()
def init(options, configuration, plugin):
plugin.log("slow_init.py initializing {}".format(configuration))
time.sleep(int(os.getenv('SLOWINIT_TIME', "0")))
plugin.run()