File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ use tokio_tungstenite::connect_async;
1313/// 2. Perform operations to verify connectivity
1414/// 3. Force disconnect
1515/// 4. Verify that the peer can reconnect and operate normally
16+ /// NOTE: The freenet_test macro configures each peer with a public network port
17+ /// so auto_connect_peers ensures they can form a full mesh rather than only
18+ /// connecting to the gateway.
1619#[ freenet_test(
1720 nodes = [ "gateway" , "peer" ] ,
1821 auto_connect_peers = true ,
@@ -246,11 +249,6 @@ async fn test_basic_gateway_connectivity(ctx: &mut TestContext) -> TestResult {
246249/// 7. Other peers connect to PublicIP:54321
247250/// 8. Router forwards to peer's internal 192.168.1.100:8080 ✅
248251///
249- /// NOTE: This test requires P2P mesh connectivity between peers.
250- /// The freenet_test macro's auto_connect_peers feature handles gateway connections
251- /// but may not fully support peer-to-peer mesh formation. This test is temporarily
252- /// marked as ignored pending investigation of P2P mesh connectivity setup.
253- #[ ignore = "P2P mesh connectivity needs investigation - auto_connect_peers may not establish peer-to-peer links" ]
254252#[ freenet_test(
255253 nodes = [ "gateway" , "peer1" , "peer2" ] ,
256254 auto_connect_peers = true ,
Original file line number Diff line number Diff line change @@ -240,6 +240,10 @@ fn generate_node_setup(args: &FreenetTestArgs) -> TokenStream {
240240 key. save( & transport_keypair) ?;
241241 key. public( ) . save( temp_dir. path( ) . join( "public.pem" ) ) ?;
242242
243+ let network_socket = std:: net:: TcpListener :: bind( "127.0.0.1:0" ) ?;
244+ let network_port = network_socket. local_addr( ) ?. port( ) ;
245+ std:: mem:: drop( network_socket) ;
246+
243247 let ws_socket = std:: net:: TcpListener :: bind( "127.0.0.1:0" ) ?;
244248 let ws_port = ws_socket. local_addr( ) ?. port( ) ;
245249 std:: mem:: drop( ws_socket) ;
@@ -255,14 +259,14 @@ fn generate_node_setup(args: &FreenetTestArgs) -> TokenStream {
255259 } ,
256260 network_api: freenet:: config:: NetworkArgs {
257261 public_address: Some ( std:: net:: Ipv4Addr :: LOCALHOST . into( ) ) ,
258- public_port: None ,
262+ public_port: Some ( network_port ) ,
259263 is_gateway: false ,
260264 skip_load_from_network: true ,
261265 gateways: #gateways_config,
262266 location: Some ( location) ,
263267 ignore_protocol_checking: true ,
264268 address: Some ( std:: net:: Ipv4Addr :: LOCALHOST . into( ) ) ,
265- network_port: None ,
269+ network_port: Some ( network_port ) ,
266270 bandwidth_limit: None ,
267271 blocked_addresses: None ,
268272 } ,
You can’t perform that action at this time.
0 commit comments