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 @@ -616,6 +616,28 @@ mod async_resolver_test {
616
616
assert ! ( matches!( hinfo_rdata, Rdata :: HINFO ( _hinfo_rdata) ) )
617
617
}
618
618
}
619
+
620
+ #[ tokio:: test]
621
+ async fn inner_lookup_qtype_tsig ( ) {
622
+ // Create a new resolver with default values
623
+ let mut resolver = AsyncResolver :: new ( ResolverConfig :: default ( ) ) ;
624
+ let domain_name = DomainName :: new_from_string ( "example.com" . to_string ( ) ) ;
625
+ let qtype = Qtype :: TSIG ;
626
+ let record_class = Qclass :: IN ;
627
+ let response = resolver. inner_lookup ( domain_name, qtype, record_class) . await ;
628
+
629
+ let response = match response {
630
+ Ok ( val) => val,
631
+ Err ( error) => panic ! ( "Error in the response: {:?}" , error) ,
632
+ } ;
633
+ //analize if the response has the correct type according with the qtype
634
+ let answers = response. get_answer ( ) ;
635
+ for answer in answers {
636
+ let tsig_rdata = answer. get_rdata ( ) ;
637
+ // Check if the answer is TSIG type
638
+ assert ! ( matches!( tsig_rdata, Rdata :: TSIG ( _tsig_rdata) ) )
639
+ }
640
+ }
619
641
#[ tokio:: test]
620
642
async fn inner_lookup_ns ( ) {
621
643
// Create a new resolver with default values
You can’t perform that action at this time.
0 commit comments