rpki/tests/test_apnic_tree_live_m15.rs
2026-02-09 19:35:54 +08:00

38 lines
1.2 KiB
Rust

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::tree::TreeRunConfig;
const APNIC_TAL_URL: &str = "https://tal.apnic.net/tal-archive/apnic-rfc7730-https.tal";
#[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 temp = tempfile::tempdir().expect("tempdir");
let store = RocksStore::open(temp.path()).expect("open rocksdb");
let policy = Policy::default();
let out = run_tree_from_tal_url_serial(
&store,
&policy,
APNIC_TAL_URL,
&http,
&rsync,
time::OffsetDateTime::now_utc(),
&TreeRunConfig {
max_depth: Some(1),
max_instances: Some(2),
},
)
.expect("run tree from tal");
assert!(
out.tree.instances_processed >= 2,
"expected to process root + at least one child"
);
}