run tree from tal pass
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use rpki::audit::{DiscoveredFrom, PublicationPointAudit};
|
||||
use rpki::report::Warning;
|
||||
use rpki::storage::{PackTime, VerifiedPublicationPointPack};
|
||||
use rpki::validation::manifest::PublicationPointSource;
|
||||
use rpki::validation::objects::{ObjectsOutput, ObjectsStats};
|
||||
use rpki::validation::tree::{
|
||||
CaInstanceHandle, PublicationPointRunResult, PublicationPointRunner, TreeRunConfig,
|
||||
run_tree_serial,
|
||||
CaInstanceHandle, DiscoveredChildCaInstance, PublicationPointRunResult, PublicationPointRunner,
|
||||
TreeRunConfig, run_tree_serial,
|
||||
};
|
||||
use rpki::audit::PublicationPointAudit;
|
||||
|
||||
fn empty_pack(manifest_uri: &str, pp_uri: &str) -> VerifiedPublicationPointPack {
|
||||
VerifiedPublicationPointPack {
|
||||
@@ -43,6 +43,25 @@ fn ca_handle(manifest_uri: &str) -> CaInstanceHandle {
|
||||
}
|
||||
}
|
||||
|
||||
fn discovered_child(
|
||||
parent_manifest_uri: &str,
|
||||
child_manifest_uri: &str,
|
||||
) -> DiscoveredChildCaInstance {
|
||||
let name = child_manifest_uri
|
||||
.rsplit('/')
|
||||
.next()
|
||||
.unwrap_or("child.mft")
|
||||
.trim_end_matches(".mft");
|
||||
DiscoveredChildCaInstance {
|
||||
handle: ca_handle(child_manifest_uri),
|
||||
discovered_from: DiscoveredFrom {
|
||||
parent_manifest_rsync_uri: parent_manifest_uri.to_string(),
|
||||
child_ca_certificate_rsync_uri: format!("rsync://example.test/repo/{name}.cer"),
|
||||
child_ca_certificate_sha256_hex: "00".repeat(32),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct ResultRunner {
|
||||
by_manifest: HashMap<String, Result<PublicationPointRunResult, String>>,
|
||||
@@ -94,7 +113,10 @@ fn tree_continues_when_a_publication_point_fails() {
|
||||
audit: Vec::new(),
|
||||
},
|
||||
audit: PublicationPointAudit::default(),
|
||||
discovered_children: vec![ca_handle(bad_child_manifest), ca_handle(ok_child_manifest)],
|
||||
discovered_children: vec![
|
||||
discovered_child(root_manifest, bad_child_manifest),
|
||||
discovered_child(root_manifest, ok_child_manifest),
|
||||
],
|
||||
},
|
||||
)
|
||||
.with_err(bad_child_manifest, "synthetic failure")
|
||||
|
||||
Reference in New Issue
Block a user