tests: update test so use both node ids
What changed, and why it matters
This commit only changes a test file. It expands an existing test to check both an old and a new HSM secret format by running the same test twice with different parameters. There is no change to production code, no bug fix, and no security-relevant behavior change.
No action required; this is a test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/test_cln_rs.py to parameterize test_rpc_client with pytest.mark.parametrize. It now runs once with old_hsmsecret=False expecting node ID 038194b5… and once with old_hsmsecret=True expecting node ID 0266e459…, asserting the expected node ID appears in the example binary output and matches l1.info[‘id’]. No application code is touched.
Changed components
tests/test_cln_rs.pyInspect captured patch +9 / −3
diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py
index e14bba45..d4908912 100644
--- a/tests/test_cln_rs.py
+++ b/tests/test_cln_rs.py
@@ -23,14 +23,20 @@ def wait_for_grpc_start(node):
wait_for(lambda: node.daemon.is_in_log(r'serving grpc'))
-def test_rpc_client(node_factory):
- l1 = node_factory.get_node()
+@pytest.mark.parametrize("old_hsmsecret,expected_node_id", [
+ (False, '038194b5f32bdf0aa59812c86c4ef7ad2f294104fa027d1ace9b469bb6f88cf37b'),
+ (True, '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'),
+])
+def test_rpc_client(node_factory, old_hsmsecret, expected_node_id):
+ l1 = node_factory.get_node(old_hsmsecret=old_hsmsecret)
bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-rpc-getinfo"
rpc_path = Path(l1.daemon.lightning_dir) / TEST_NETWORK / "lightning-rpc"
if len(str(rpc_path)) >= 108 and os.uname()[0] == 'Linux':
rpc_path = Path('/proc/self/cwd') / os.path.relpath(rpc_path)
out = subprocess.check_output([bin_path, rpc_path], stderr=subprocess.STDOUT)
- assert(b'0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518' in out)
+ # Check that the expected node ID appears in the output
+ assert expected_node_id.encode() in out
+ assert l1.info['id'] == expected_node_id
def test_plugin_start(node_factory):
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.