MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_plugin_fail

Function test_plugin_fail

tests/test_plugin.py:2526–2542  ·  view source on GitHub ↗

Test that a plugin which fails (not during a command)

(node_factory)

Source from the content-addressed store, hash-verified

2524
2525
2526def test_plugin_fail(node_factory):
2527 """Test that a plugin which fails (not during a command)"""
2528 plugin = os.path.join(os.path.dirname(__file__), 'plugins/fail_by_itself.py')
2529 l1 = node_factory.get_node(options={"plugin": plugin})
2530
2531 time.sleep(2)
2532 # It should clean up!
2533 assert 'failcmd' not in [h['command'] for h in l1.rpc.help()['help']]
2534 # Can happen *before* the 'Server started with public key'
2535 l1.daemon.logsearch_start = 0
2536 l1.daemon.wait_for_log(r': exited during normal operation')
2537
2538 l1.rpc.plugin_start(plugin)
2539 time.sleep(2)
2540 # It should clean up!
2541 assert 'failcmd' not in [h['command'] for h in l1.rpc.help()['help']]
2542 l1.daemon.wait_for_log(r': exited during normal operation')
2543
2544
2545@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
wait_for_logMethod · 0.80
plugin_startMethod · 0.80
get_nodeMethod · 0.45
helpMethod · 0.45

Tested by

no test coverage detected