diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 0327b3010..ab221b9d2 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -9,7 +9,7 @@ from utils import ( DEPRECATED_APIS, expected_peer_features, expected_node_features, expected_channel_features, account_balance, check_coin_moves, first_channel_id, EXPERIMENTAL_DUAL_FUND, - mine_funding_to_announce + mine_funding_to_announce, VALGRIND ) import ast @@ -4275,6 +4275,18 @@ def test_renepay_not_important(node_factory): l1.rpc.plugin_start(os.path.join(os.getcwd(), 'plugins/cln-renepay')) +@pytest.mark.xfail(strict=True) +@unittest.skipIf(VALGRIND, "Valgrind doesn't handle bad #! lines the same") +def test_plugin_nostart(node_factory): + "Should not appear in list if it didn't even start" + + l1 = node_factory.get_node() + with pytest.raises(RpcError, match="badinterp.py: opening pipe: No such file or directory"): + l1.rpc.plugin_start(os.path.join(os.getcwd(), 'tests/plugins/badinterp.py')) + + assert [p['name'] for p in l1.rpc.plugin_list()['plugins'] if 'badinterp' in p['name']] == [] + + @pytest.mark.xfail(strict=True) def test_plugin_startdir_lol(node_factory): """Though we fail to start many of them, we don't crash!"""