From 6cf9413d4be708658fe692a6daab38f24cf5c5f6 Mon Sep 17 00:00:00 2001 From: FranciscaOrtegaG Date: Thu, 16 Nov 2023 14:46:00 -0300 Subject: [PATCH] doing poll lookup max tries test --- src/resolver/lookup.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/resolver/lookup.rs b/src/resolver/lookup.rs index 4acd1c0b..7062ec33 100644 --- a/src/resolver/lookup.rs +++ b/src/resolver/lookup.rs @@ -423,7 +423,7 @@ mod async_resolver_test { assert!(answer.is_empty()); } - #[tokio::test] //FIXME: se cae + #[tokio::test] async fn poll_lookup_max_tries(){ let domain_name = DomainName::new_from_string("example.com".to_string()); @@ -436,15 +436,19 @@ mod async_resolver_test { let conn_udp:ClientUDPConnection = ClientUDPConnection::new(non_existent_server, timeout); let conn_tcp:ClientTCPConnection = ClientTCPConnection::new(non_existent_server, timeout); config.set_name_servers(vec![(conn_udp,conn_tcp)]); - config.set_retry(1); + config.set_retry(10); let response_future = LookupFutureStub::lookup(domain_name, record_type ,config).await; println!("response_future {:?}",response_future); assert_eq!(response_future.is_ok(), true); - // assert_eq!(response_future.unwrap().get_header().get_ancount(), 0); - assert_eq!(response_future.unwrap().get_header().get_rcode() , 2); - // assert_eq!(response_future.unwrap().get_header().get_rcode() , 2); //FIXME: + let response = response_future.unwrap(); + assert_eq!(response.get_header().get_rcode() , 2); + + let answer = response.get_answer(); + assert!(answer.is_empty()); + + } #[tokio::test]