File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -594,6 +594,28 @@ mod async_resolver_test {
594
594
assert ! ( matches!( cname_rdata, Rdata :: CNAME ( _cname_rdata) ) )
595
595
}
596
596
}
597
+
598
+ #[ tokio:: test]
599
+ async fn inner_lookup_qtype_hinfo ( ) {
600
+ // Create a new resolver with default values
601
+ let mut resolver = AsyncResolver :: new ( ResolverConfig :: default ( ) ) ;
602
+ let domain_name = DomainName :: new_from_string ( "example.com" . to_string ( ) ) ;
603
+ let qtype = Qtype :: HINFO ;
604
+ let record_class = Qclass :: IN ;
605
+ let response = resolver. inner_lookup ( domain_name, qtype, record_class) . await ;
606
+
607
+ let response = match response {
608
+ Ok ( val) => val,
609
+ Err ( error) => panic ! ( "Error in the response: {:?}" , error) ,
610
+ } ;
611
+ //analize if the response has the correct type according with the qtype
612
+ let answers = response. get_answer ( ) ;
613
+ for answer in answers {
614
+ let hinfo_rdata = answer. get_rdata ( ) ;
615
+ // Check if the answer is HINFO type
616
+ assert ! ( matches!( hinfo_rdata, Rdata :: HINFO ( _hinfo_rdata) ) )
617
+ }
618
+ }
597
619
#[ tokio:: test]
598
620
async fn inner_lookup_ns ( ) {
599
621
// Create a new resolver with default values
You can’t perform that action at this time.
0 commit comments