Skip to content

Commit 388c564

Browse files
committed
remove redundant test in manage_packets.rs
1 parent 6a0d5a7 commit 388c564

1 file changed

Lines changed: 1 addition & 56 deletions

File tree

src/networking/manage_packets.rs

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -534,14 +534,9 @@ mod tests {
534534
use crate::Service;
535535
use crate::networking::manage_packets::{
536536
get_service, get_traffic_direction, get_traffic_type, is_local_connection,
537-
mac_from_dec_to_hex, modify_or_insert_in_map,
537+
mac_from_dec_to_hex,
538538
};
539539
use crate::networking::types::address_port_pair::AddressPortPair;
540-
use crate::networking::types::arp_type::ArpType;
541-
use crate::networking::types::capture_context::{CaptureSource, MyPcapImport};
542-
use crate::networking::types::icmp_type::IcmpType;
543-
use crate::networking::types::info_traffic::InfoTraffic;
544-
use crate::networking::types::ip_blacklist::IpBlacklist;
545540
use crate::networking::types::service_query::ServiceQuery;
546541
use crate::networking::types::traffic_direction::TrafficDirection;
547542
use crate::networking::types::traffic_type::TrafficType;
@@ -1539,56 +1534,6 @@ mod tests {
15391534
}
15401535
}
15411536

1542-
#[tokio::test]
1543-
async fn test_cidr_blacklist_marks_remote_address_blacklisted() {
1544-
let blacklist =
1545-
IpBlacklist::from_file("resources/test/ip_blacklist_real_cidr_ranges.txt".to_string())
1546-
.await;
1547-
let mut info_traffic = InfoTraffic::default();
1548-
let capture_source = CaptureSource::File(MyPcapImport::new(String::new()));
1549-
let key = AddressPortPair::new(
1550-
IpAddr::from_str("192.168.1.10").unwrap(),
1551-
Some(50000),
1552-
IpAddr::from_str("209.186.21.7").unwrap(),
1553-
Some(443),
1554-
Protocol::TCP,
1555-
);
1556-
1557-
modify_or_insert_in_map(
1558-
&mut info_traffic,
1559-
&key,
1560-
&capture_source,
1561-
(None, None),
1562-
IcmpType::default(),
1563-
ArpType::default(),
1564-
100,
1565-
&blacklist,
1566-
);
1567-
1568-
assert!(info_traffic.map.get(&key).unwrap().is_blacklisted);
1569-
1570-
let key = AddressPortPair::new(
1571-
IpAddr::from_str("192.168.1.10").unwrap(),
1572-
Some(50001),
1573-
IpAddr::from_str("209.186.237.1").unwrap(),
1574-
Some(443),
1575-
Protocol::TCP,
1576-
);
1577-
1578-
modify_or_insert_in_map(
1579-
&mut info_traffic,
1580-
&key,
1581-
&capture_source,
1582-
(None, None),
1583-
IcmpType::default(),
1584-
ArpType::default(),
1585-
100,
1586-
&blacklist,
1587-
);
1588-
1589-
assert!(!info_traffic.map.get(&key).unwrap().is_blacklisted);
1590-
}
1591-
15921537
#[test]
15931538
fn test_get_service_unknown() {
15941539
let unknown_port_1 = Some(39332);

0 commit comments

Comments
 (0)