Skip to content

Commit aa7aadf

Browse files
committed
add extra confirmation in test filter_timout_cache_data_cleaning_layer_down
1 parent fa7c89d commit aa7aadf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/dns_cache/cache_by_record_type.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,26 @@ mod cache_data_test{
10151015
println!("the cache by domain for A type after the cleaning is : \n {:?}",record_types_data_a.get_domain_names_data());
10161016
//FIXME: Does not delete the invadil rrstore, instead points to a empty array (same error as in cache by domain)
10171017
assert_eq!(record_types_data_a.get_domain_names_data().len(), 1);
1018+
//check if is the same resource record valid (which survives)
1019+
if let Some(rrstore_a_after_cleaning) = record_types_data_a.clone().get_from_host_data(domain_name_1.clone()){
1020+
if let Some(rrstore_data_valid) = rrstore_a_after_cleaning.get(0){
1021+
let resource_record_after_filter = rrstore_data_valid.get_resource_record();
1022+
assert_eq!(resource_record_after_filter, resource_record_valid_a);
1023+
}
1024+
}
10181025
}
10191026
//CacheByDomainName for NS type
10201027
if let Some(record_types_data_ns) = record_types_data_after_cleaning.get(&Rtype::NS) {
10211028
println!("the cache by domain for NS type after the cleaning is : \n {:?}",record_types_data_ns.get_domain_names_data());
10221029
//FIXME: Does not delete the invadil rrstore, instead points to a empty array (same error as in cache by domain)
10231030
assert_eq!(record_types_data_ns.get_domain_names_data().len(), 1);
1031+
//check if is the same resource record valid (which survives)
1032+
if let Some(rrstore_ns_after_cleaning) = record_types_data_ns.clone().get_from_host_data(domain_name_2.clone()){
1033+
if let Some(rrstore_data_valid) = rrstore_ns_after_cleaning.get(0){
1034+
let resource_record_after_filter = rrstore_data_valid.get_resource_record();
1035+
assert_eq!(resource_record_after_filter, resource_record_valid_a);
1036+
}
1037+
}
10241038
}
10251039

10261040

0 commit comments

Comments
 (0)