From 8c1006c69e367718ec9ccb3a543c87bec9615cde Mon Sep 17 00:00:00 2001 From: Sean Klein Date: Thu, 7 May 2026 17:50:45 -0700 Subject: [PATCH] Place SP task dumps under `sp_task_dumps/` in support bundles `spawn_collection_steps` creates an `sp_task_dumps/` directory in the bundle root, but the per-SP closure it spawned captured the framework's outer `dir` (the bundle root) instead of the subdirectory. As a result the dumps landed at `/sled_0/dump-0.zip`, `/switch_0/...`, etc., while `sp_task_dumps/` was created and left empty. Capture `sp_dumps_dir` into the spawned closure so dumps land at `sp_task_dumps/{sp.type}_{sp.slot}/dump-{i}.zip` as the surrounding code intended. --- dev-tools/omdb/tests/test_all_output.rs | 12 +++++++++--- support-bundle-collection/src/steps/sp_dumps.rs | 14 +++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dev-tools/omdb/tests/test_all_output.rs b/dev-tools/omdb/tests/test_all_output.rs index 0dd1b55843f..da1d241309b 100644 --- a/dev-tools/omdb/tests/test_all_output.rs +++ b/dev-tools/omdb/tests/test_all_output.rs @@ -472,9 +472,15 @@ async fn test_omdb_success_cases() { }); let mut archive = zip::ZipArchive::new(zip_file).expect("bundle is a valid zip archive"); - for required in - ["bundle_id.txt", "meta/reason_for_creation.txt", "meta/trace.json"] - { + for required in [ + "bundle_id.txt", + "meta/reason_for_creation.txt", + "meta/trace.json", + "sp_task_dumps/sled_0/dump-0.zip", + "sp_task_dumps/sled_1/dump-0.zip", + "sp_task_dumps/switch_0/dump-0.zip", + "sp_task_dumps/switch_1/dump-0.zip", + ] { assert!( archive.by_name(required).is_ok(), "bundle zip is missing expected entry {required}", diff --git a/support-bundle-collection/src/steps/sp_dumps.rs b/support-bundle-collection/src/steps/sp_dumps.rs index 496be1eb065..e6a1bf517f1 100644 --- a/support-bundle-collection/src/steps/sp_dumps.rs +++ b/support-bundle-collection/src/steps/sp_dumps.rs @@ -48,16 +48,16 @@ pub async fn spawn_collection_steps( let mut extra_steps: Vec = vec![]; for sp in available_sps { + let mgs_client = mgs_client.clone(); + let sp_dumps_dir = sp_dumps_dir.clone(); extra_steps.push(CollectionStep::new( format!("SP dump for {:?}", sp), - Box::new({ - let mgs_client = mgs_client.clone(); - move |collection, dir| { - async move { - collect_sp_dump(collection, &mgs_client, sp, dir).await - } - .boxed() + Box::new(move |collection, _dir| { + async move { + collect_sp_dump(collection, &mgs_client, sp, &sp_dumps_dir) + .await } + .boxed() }), )); }