MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / roundtrip_join_request

Function roundtrip_join_request

nodedb-cluster/src/rpc_codec/cluster_mgmt.rs:182–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 #[test]
182 fn roundtrip_join_request() {
183 let req = JoinRequest {
184 node_id: 42,
185 listen_addr: "10.0.0.5:9400".into(),
186 wire_version: crate::topology::CLUSTER_WIRE_FORMAT_VERSION,
187 spiffe_id: Some("spiffe://cluster.local/node/42".into()),
188 spki_pin: Some(vec![0xabu8; 32]),
189 };
190 match roundtrip(RaftRpc::JoinRequest(req)) {
191 RaftRpc::JoinRequest(d) => {
192 assert_eq!(d.node_id, 42);
193 assert_eq!(d.listen_addr, "10.0.0.5:9400");
194 assert_eq!(
195 d.spiffe_id.as_deref(),
196 Some("spiffe://cluster.local/node/42")
197 );
198 assert_eq!(d.spki_pin.as_deref(), Some([0xabu8; 32].as_ref()));
199 }
200 other => panic!("expected JoinRequest, got {other:?}"),
201 }
202 }
203
204 #[test]
205 fn roundtrip_join_response() {

Callers

nothing calls this directly

Calls 2

JoinRequestClass · 0.85
roundtripFunction · 0.70

Tested by

no test coverage detected