run tree from tal pass
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use rpki::fetch::http::{BlockingHttpFetcher, HttpFetcherConfig};
|
||||
use rpki::fetch::rsync_system::{SystemRsyncConfig, SystemRsyncFetcher};
|
||||
use rpki::policy::Policy;
|
||||
use rpki::storage::RocksStore;
|
||||
use rpki::validation::run_tree_from_tal::run_tree_from_tal_url_serial;
|
||||
use rpki::validation::run_tree_from_tal::run_tree_from_tal_url_serial_audit;
|
||||
use rpki::validation::tree::TreeRunConfig;
|
||||
|
||||
const APNIC_TAL_URL: &str = "https://tal.apnic.net/tal-archive/apnic-rfc7730-https.tal";
|
||||
@@ -10,8 +13,15 @@ const APNIC_TAL_URL: &str = "https://tal.apnic.net/tal-archive/apnic-rfc7730-htt
|
||||
#[test]
|
||||
#[ignore = "live network + rsync smoke test (APNIC TAL)"]
|
||||
fn apnic_tree_depth1_processes_more_than_root() {
|
||||
let http = BlockingHttpFetcher::new(HttpFetcherConfig::default()).expect("http fetcher");
|
||||
let rsync = SystemRsyncFetcher::new(SystemRsyncConfig::default());
|
||||
let http = BlockingHttpFetcher::new(HttpFetcherConfig {
|
||||
timeout: Duration::from_secs(30 * 60),
|
||||
..HttpFetcherConfig::default()
|
||||
})
|
||||
.expect("http fetcher");
|
||||
let rsync = SystemRsyncFetcher::new(SystemRsyncConfig {
|
||||
timeout: Duration::from_secs(30 * 60),
|
||||
..SystemRsyncConfig::default()
|
||||
});
|
||||
|
||||
let temp = tempfile::tempdir().expect("tempdir");
|
||||
let store = RocksStore::open(temp.path()).expect("open rocksdb");
|
||||
@@ -35,3 +45,46 @@ fn apnic_tree_depth1_processes_more_than_root() {
|
||||
"expected to process root + at least one child"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "live network + rsync root-only smoke test (APNIC TAL); 30min timeouts"]
|
||||
fn apnic_tree_root_only_processes_root_with_long_timeouts() {
|
||||
let http = BlockingHttpFetcher::new(HttpFetcherConfig {
|
||||
timeout: Duration::from_secs(30 * 60),
|
||||
..HttpFetcherConfig::default()
|
||||
})
|
||||
.expect("http fetcher");
|
||||
let rsync = SystemRsyncFetcher::new(SystemRsyncConfig {
|
||||
timeout: Duration::from_secs(30 * 60),
|
||||
..SystemRsyncConfig::default()
|
||||
});
|
||||
|
||||
let temp = tempfile::tempdir().expect("tempdir");
|
||||
let store = RocksStore::open(temp.path()).expect("open rocksdb");
|
||||
let policy = Policy::default();
|
||||
let validation_time = time::OffsetDateTime::now_utc();
|
||||
|
||||
let out = run_tree_from_tal_url_serial_audit(
|
||||
&store,
|
||||
&policy,
|
||||
APNIC_TAL_URL,
|
||||
&http,
|
||||
&rsync,
|
||||
validation_time,
|
||||
&TreeRunConfig {
|
||||
max_depth: Some(0),
|
||||
max_instances: Some(1),
|
||||
},
|
||||
)
|
||||
.expect("run APNIC root-only");
|
||||
|
||||
assert_eq!(
|
||||
out.tree.instances_processed, 1,
|
||||
"expected to process exactly the root publication point"
|
||||
);
|
||||
assert_eq!(
|
||||
out.publication_points.len(),
|
||||
out.tree.instances_processed,
|
||||
"audit should include one publication point"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user