Commit fb17cc6
feat(macros): add peer_connectivity_ratio attribute to freenet_test
Add support for configuring partial connectivity between peer nodes in
freenet_test macro. This enables testing of subscription propagation in
partially connected networks.
Changes:
- Add peer_connectivity_ratio (0.0-1.0) attribute to FreenetTestArgs
- Generate blocked_addresses based on deterministic connectivity ratio
- Pre-compute peer network ports when connectivity ratio is specified
- Use (i * j) % 100 >= (ratio * 100) formula for deterministic blocking
This feature is needed for test_ping_partially_connected_network which
verifies subscription propagation across a network where regular nodes
have partial connectivity to each other but full connectivity to
gateways.
Example usage:
#[freenet_test(
nodes = ["gw-0", "gw-1", "node-0", "node-1", "node-2"],
gateways = ["gw-0", "gw-1"],
auto_connect_peers = true,
peer_connectivity_ratio = 0.5 // 50% connectivity between peers
)]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 9e6c39d commit fb17cc6
2 files changed
+75
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
193 | 222 | | |
194 | 223 | | |
195 | 224 | | |
| |||
230 | 259 | | |
231 | 260 | | |
232 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
233 | 290 | | |
234 | 291 | | |
235 | 292 | | |
| |||
249 | 306 | | |
250 | 307 | | |
251 | 308 | | |
| 309 | + | |
| 310 | + | |
252 | 311 | | |
253 | 312 | | |
254 | 313 | | |
| |||
267 | 326 | | |
268 | 327 | | |
269 | 328 | | |
270 | | - | |
| 329 | + | |
271 | 330 | | |
272 | 331 | | |
273 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
162 | 176 | | |
163 | 177 | | |
164 | 178 | | |
| |||
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
| 218 | + | |
204 | 219 | | |
205 | 220 | | |
206 | 221 | | |
| |||
0 commit comments