From c653955de10784c057455496576b245fe9b90a24 Mon Sep 17 00:00:00 2001 From: Sangbida Chaudhuri <101164840+sangbida@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:29:28 +1030 Subject: [PATCH] tests: update test so use both node ids This test has been split into two to assert on both the old and the new hsm_secret --- tests/test_cln_rs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index e14bba45c..d49089128 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):