Skip to content

Commit 340a731

Browse files
tonyaldonvincenzopalazzo
authored andcommitted
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.
1 parent ae94be4 commit 340a731

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_cln_rs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99
import subprocess
1010
import os
11+
import re
1112

1213
# Skip the entire module if we don't have Rust.
1314
pytestmark = pytest.mark.skipif(
@@ -178,11 +179,16 @@ def test_grpc_generate_certificate(node_factory):
178179

179180
def test_grpc_no_auto_start(node_factory):
180181
"""Ensure that we do not start cln-grpc unless a port is configured.
182+
Also check that we do not generate certificates.
181183
"""
182184
l1 = node_factory.get_node()
183185

184186
wait_for(lambda: [p for p in l1.rpc.plugin('list')['plugins'] if 'cln-grpc' in p['name']] == [])
185187
assert l1.daemon.is_in_log(r'plugin-cln-grpc: Killing plugin: disabled itself at init')
188+
p = Path(l1.daemon.lightning_dir) / TEST_NETWORK
189+
files = os.listdir(p)
190+
pem_files = [f for f in files if re.match(r".*\.pem$", f)]
191+
assert pem_files == []
186192

187193

188194
def test_grpc_wrong_auth(node_factory):

0 commit comments

Comments
 (0)