From 340a7316d6a8c808cd44dbe00c6a0fa0781a38dd Mon Sep 17 00:00:00 2001 From: Tony Aldon Date: Tue, 10 Oct 2023 10:59:48 +0200 Subject: [PATCH] pytest: test that cln-grpc certificates are not generated when cln-grpc is not started. We update `test_grpc_no_auto_start` test to check that we do not generate certificates when the cln-grpc plugin is not started. This fails currently, so next commit fix it up. --- tests/test_cln_rs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index 52a36f631..2ef354dbf 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -8,6 +8,7 @@ import grpc import pytest import subprocess import os +import re # Skip the entire module if we don't have Rust. pytestmark = pytest.mark.skipif( @@ -178,11 +179,16 @@ def test_grpc_generate_certificate(node_factory): def test_grpc_no_auto_start(node_factory): """Ensure that we do not start cln-grpc unless a port is configured. + Also check that we do not generate certificates. """ l1 = node_factory.get_node() wait_for(lambda: [p for p in l1.rpc.plugin('list')['plugins'] if 'cln-grpc' in p['name']] == []) assert l1.daemon.is_in_log(r'plugin-cln-grpc: Killing plugin: disabled itself at init') + p = Path(l1.daemon.lightning_dir) / TEST_NETWORK + files = os.listdir(p) + pem_files = [f for f in files if re.match(r".*\.pem$", f)] + assert pem_files == [] def test_grpc_wrong_auth(node_factory):