@@ -28,6 +28,7 @@ use node_lib::sub_lib::versioned_data::VersionedData;
28
28
use node_lib:: test_utils:: assert_string_contains;
29
29
use node_lib:: test_utils:: neighborhood_test_utils:: { db_from_node, make_node_record} ;
30
30
use std:: convert:: TryInto ;
31
+ use std:: net:: Ipv4Addr ;
31
32
use std:: thread;
32
33
use std:: time:: Duration ;
33
34
@@ -271,6 +272,39 @@ fn dns_resolution_failure_with_real_nodes() {
271
272
) ;
272
273
}
273
274
275
+ #[ test]
276
+ fn dns_resolution_failure_for_wildcard_ip_with_real_nodes ( ) {
277
+ let mut cluster = MASQNodeCluster :: start ( ) . unwrap ( ) ;
278
+ let exit_node = cluster. start_real_node (
279
+ NodeStartupConfigBuilder :: standard ( )
280
+ . chain ( cluster. chain )
281
+ . dns_servers ( vec ! [ Ipv4Addr :: new( 1 , 1 , 1 , 3 ) . into( ) ] )
282
+ . build ( ) ,
283
+ ) ;
284
+
285
+ let originating_node = cluster. start_real_node (
286
+ NodeStartupConfigBuilder :: standard ( )
287
+ . neighbor ( exit_node. node_reference ( ) )
288
+ . consuming_wallet_info ( make_consuming_wallet_info ( "last_node" ) )
289
+ . chain ( cluster. chain )
290
+ . min_hops ( Hops :: OneHop )
291
+ . build ( ) ,
292
+ ) ;
293
+
294
+ thread:: sleep ( Duration :: from_millis ( 2000 ) ) ;
295
+
296
+ let mut client = originating_node. make_client ( 8080 , 20_000 ) ;
297
+ client. send_chunk ( b"GET / HTTP/1.1\r \n Host: www.xvideos.com\r \n \r \n " ) ;
298
+ let response = client. wait_for_chunk ( ) ;
299
+
300
+ assert_eq ! (
301
+ index_of( & response, & b"<h1>Example Domain</h1>" [ ..] ) . is_some( ) ,
302
+ true ,
303
+ "Actual response:\n {}" ,
304
+ String :: from_utf8( response) . unwrap( )
305
+ ) ;
306
+ }
307
+
274
308
#[ test]
275
309
fn dns_resolution_failure_no_longer_blacklists_exit_node_for_all_hosts ( ) {
276
310
let mut cluster = MASQNodeCluster :: start ( ) . unwrap ( ) ;
0 commit comments