Skip to content

Commit

Permalink
pytest: test that cln-grpc certificates are not generated when cln-gr…
Browse files Browse the repository at this point in the history
…pc 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.
  • Loading branch information
tonyaldon committed Oct 13, 2023
1 parent 176a58f commit 3d8d0c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_cln_rs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest
import subprocess
import os
import re

# Skip the entire module if we don't have Rust.
pytestmark = pytest.mark.skipif(
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 3d8d0c5

Please sign in to comment.