diff options
| author | tv <tv@krebsco.de> | 2026-10-28 03:17:29 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 03:17:29 +0100 |
| commit | 30c2ca8537fbc2874ec6e14cdd1ae5477c95f099 (patch) | |
| tree | ecdb99d28bed6c5d9ed19637c1e725c9b2a532ca /src/simtest/identity.rs | |
| parent | 614e57396d11700721660d54f3d90a4f01cfae7d (diff) | |
measure RTT on single link paths, too
Diffstat (limited to 'src/simtest/identity.rs')
| -rw-r--r-- | src/simtest/identity.rs | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/simtest/identity.rs b/src/simtest/identity.rs index e93b1da..61a54d5 100644 --- a/src/simtest/identity.rs +++ b/src/simtest/identity.rs @@ -14,10 +14,7 @@ use crate::swarm::bootstrap::Start; use crate::swarm::members; use crate::transport::identity::{WHO_LABEL, signed}; use crate::transport::sim::SimNet; -use crate::transport::stats::PathInfo; -use crate::transport::{ - Destination, HeadsSummary, IdentityProof, ParsedMessage, Status, Transport, -}; +use crate::transport::{HeadsSummary, IdentityProof, ParsedMessage, Status, Transport}; const SOON: Duration = Duration::from_secs(20); @@ -45,20 +42,18 @@ async fn nodes_are_their_node_ids() { peers_are_node_ids(node).await; } // Where a sends to b: where b proved itself, on the sim's transport. + let destination = a.transport.destination(b.local_id()).unwrap(); assert_eq!( - a.transport.destination(b.local_id()), - Some(Destination { - address: "sim:b".into(), - proven: true, - connection: None, - // One path: nothing to choose, so nothing measured. - paths: vec![PathInfo { - address: "sim:b".into(), - rtt_ms: None, - down: false, - }], - }) + ( + destination.address.as_str(), + destination.proven, + destination.connection + ), + ("sim:b", true, None) ); + // Its only path, measured by keepalives once there were any. + assert_eq!(destination.paths.len(), 1); + assert_eq!(destination.paths[0].address, "sim:b"); let stats = a.transport.stats(); assert_eq!(stats.identity.unwrap().proven["sim"], 2); assert!(stats.libp2p.is_none()); |
