From b7102d0296a1b06204a582ecedf3bfbabaf1109e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 23:45:31 +0000 Subject: simtest: a group naming many nodes is not every node's neighbours `store_attack_19`: makefu lists five nodes, tv two, and lass one, whose operator names tv's too (`--store-neighbour-parties`); each node keeps two neighbours by the graph among all members. a and b keep each other, and c one of them, whatever makefu's nodes are. The simulations' nodes started from the root may have their configuration adjusted. --- src/simtest/holding.rs | 52 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/simtest/holding.rs b/src/simtest/holding.rs index c5f8e96..e760c8a 100644 --- a/src/simtest/holding.rs +++ b/src/simtest/holding.rs @@ -24,6 +24,7 @@ use crate::files::Files; use crate::node::NodeConfig; use crate::state::AppState; use crate::swarm::bootstrap::{Origin, Start}; +use crate::swarm::topology; /// How long a test waits for what takes a few rounds of syncs, writes and reads. const LONG: Duration = Duration::from_secs(30); @@ -107,6 +108,16 @@ fn of_the_store(config: &mut NodeConfig, id: Id, root: Option<&[u8]>, holding: H /// Starts `nodes`, each by its name with what it keeps of its store, from the store's /// `root`, the first one the others' seed, and waits until each holds the store. async fn started(sim: &Sim, root: &[u8], nodes: Vec<(&str, Holding)>) -> Vec { + started_with(sim, root, nodes, |_| {}).await +} + +/// [`started`], each node's configuration adjusted by `adjust` too. +async fn started_with( + sim: &Sim, + root: &[u8], + nodes: Vec<(&str, Holding)>, + adjust: fn(&mut NodeConfig), +) -> Vec { let id = Id::of(root); let first = nodes[0].0.to_owned(); let states: Vec = nodes @@ -122,7 +133,10 @@ async fn started(sim: &Sim, root: &[u8], nodes: Vec<(&str, Holding)>) -> Vec