Add local pipe registry commands

This commit is contained in:
Eric Wendland 2026-05-17 20:17:26 +02:00
commit c991825127
13 changed files with 235 additions and 14 deletions

View file

@ -873,6 +873,74 @@ fn pubsub_pub_sub_uses_lossy_in_memory_runtime() {
);
}
#[test]
fn pipe_listen_connect_uses_local_runtime_registry() {
let home = tempfile::tempdir().expect("tempdir");
let paths = geth_config::GethPaths::from_home(home.path());
let node = geth_node::init_node(&paths).expect("init node");
let response = geth_node::handle_request(
&node,
geth_control::ControlRequest::PipeListen {
name: "inbox".to_owned(),
},
)
.expect("listen pipe");
match response {
geth_control::ControlResponse::PipeListening { listener } => {
assert_eq!(listener.id.to_string(), "pipe:inbox");
assert_eq!(listener.name, "inbox");
assert!(listener.note.contains("local daemon registry"));
}
other => panic!("unexpected response: {other:?}"),
}
let response = geth_node::handle_request(
&node,
geth_control::ControlRequest::PipeConnect {
target: "inbox".to_owned(),
},
)
.expect("connect pipe");
match response {
geth_control::ControlResponse::PipeConnected { connection } => {
assert_eq!(connection.target, "inbox");
assert!(connection.local_listener_found);
assert!(
connection
.note
.contains("Iroh transport are not implemented")
);
}
other => panic!("unexpected response: {other:?}"),
}
let reopened = geth_node::open_node(&paths).expect("reopen node");
let response = geth_node::handle_request(
&reopened,
geth_control::ControlRequest::PipeConnect {
target: "inbox".to_owned(),
},
)
.expect("connect after reopen");
match response {
geth_control::ControlResponse::PipeConnected { connection } => {
assert!(!connection.local_listener_found);
}
other => panic!("unexpected response: {other:?}"),
}
assert!(
geth_node::handle_request(
&node,
geth_control::ControlRequest::PipeListen {
name: "../bad".to_owned(),
},
)
.is_err()
);
}
#[test]
fn ssh_cert_request_approval_and_revocation_export_use_local_state() {
let home = tempfile::tempdir().expect("tempdir");