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
This commit is contained in:
Sangbida Chaudhuri
2026-01-21 06:29:28 +10:30
committed by Rusty Russell
parent 9d331f5455
commit c653955de1

View File

@@ -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):