Skip to content

Commit

Permalink
doing poll lookup max tries test
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscaOrtegaG committed Nov 16, 2023
1 parent 33e42be commit 6cf9413
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/resolver/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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]
Expand Down

0 comments on commit 6cf9413

Please sign in to comment.