20260427_5 支持all5 CIR replay多TAL

This commit is contained in:
2026-04-28 00:20:12 +08:00
parent e2901df3ac
commit 0295fd3262
9 changed files with 178 additions and 35 deletions

View File

@@ -461,8 +461,7 @@ pub fn parse_args(argv: &[String]) -> Result<CliArgs, String> {
));
}
if !tal_paths.is_empty() {
let strict_pairing_required = tal_paths.len() > 1 || !ta_paths.is_empty();
if strict_pairing_required {
if !ta_paths.is_empty() {
if ta_paths.len() != tal_paths.len() {
return Err(format!(
"--tal-path and --ta-path counts must match in file mode\n\n{}",
@@ -2170,6 +2169,30 @@ mod tests {
);
}
#[test]
fn parse_accepts_multiple_tal_paths_without_ta_when_disable_rrdp() {
let argv = vec![
"rpki".to_string(),
"--db".to_string(),
"db".to_string(),
"--tal-path".to_string(),
"a.tal".to_string(),
"--tal-path".to_string(),
"b.tal".to_string(),
"--disable-rrdp".to_string(),
"--rsync-command".to_string(),
"/tmp/fake-rsync".to_string(),
];
let args = parse_args(&argv).expect("parse");
assert_eq!(
args.tal_paths,
vec![PathBuf::from("a.tal"), PathBuf::from("b.tal")]
);
assert!(args.ta_paths.is_empty());
assert_eq!(args.tal_inputs.len(), 2);
assert!(args.disable_rrdp);
}
#[test]
fn parse_accepts_payload_delta_replay_mode_with_offline_tal_and_ta() {
let argv = vec![