From 7afbb52eb2eb30a02ac2eccd2852a7394408e9d4 Mon Sep 17 00:00:00 2001 From: Tim Bruijnzeels Date: Mon, 25 May 2020 13:58:16 +0200 Subject: [PATCH] Remove test generating roa table json, which is already tested in analyser.rs --- src/commons/bgp/roa_table.rs | 59 +----------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/src/commons/bgp/roa_table.rs b/src/commons/bgp/roa_table.rs index 809b9fbe..52b40c2a 100644 --- a/src/commons/bgp/roa_table.rs +++ b/src/commons/bgp/roa_table.rs @@ -131,61 +131,4 @@ impl RoaTable { //------------ Tests ------------------------------------------------------- -#[cfg(test)] -mod tests { - use std::str::FromStr; - - use super::*; - - fn announcement(s: &str) -> Announcement { - let def = definition(s); - Announcement::from(def) - } - - fn definition(s: &str) -> RoaDefinition { - RoaDefinition::from_str(s).unwrap() - } - - #[test] - fn roa_table_json() { - let roa_authorizing = definition("10.0.0.0/23-24 => 64496"); - let ann_authz_1 = announcement("10.0.0.0/24 => 64496"); - let ann_authz_2 = announcement("10.0.1.0/24 => 64496"); - let ann_invalid_1 = announcement("10.0.0.0/24 => 64497"); - let ann_invalid_2 = announcement("10.0.1.0/24 => 64497"); - let ann_invalid_3 = announcement("10.0.4.0/24 => 64497"); - - let ann_not_found = announcement("10.0.2.0/24 => 64497"); - let roa_stale = definition("10.0.3.0/24 => 64497"); - let roa_disallowing = definition("10.0.4.0/24 => 0"); - - let mut entries = vec![]; - entries.push(RoaTableEntry::roa_authorizing( - roa_authorizing, - vec![ann_authz_1, ann_authz_2], - vec![ann_invalid_1.clone(), ann_invalid_2.clone()], - )); - entries.push(RoaTableEntry::announcement_invalid_length( - ann_invalid_1, - vec![roa_authorizing], - )); - entries.push(RoaTableEntry::announcement_invalid_length( - ann_invalid_2, - vec![roa_authorizing], - )); - entries.push(RoaTableEntry::announcement_invalid_length( - ann_invalid_3.clone(), - vec![roa_disallowing], - )); - entries.push(RoaTableEntry::announcement_not_found(ann_not_found)); - entries.push(RoaTableEntry::roa_stale(roa_stale)); - entries.push(RoaTableEntry::roa_disallowing( - roa_disallowing, - vec![ann_invalid_3], - )); - - let table = RoaTable(entries); - - eprintln!("{}", serde_json::to_string_pretty(&table).unwrap()); - } -} +// tested as part of tests in analyser.rs