mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-28 12:24:52 +02:00
Remove test generating roa table json, which is already tested in analyser.rs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user