Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Oct 24, 2023
1 parent 79bd794 commit 91742c6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sled-agent/src/zone_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1823,11 +1823,10 @@ mod illumos_tests {
// expected disk structure.
struct ResourceWrapper {
storage_handle: StorageHandle,
zpool_names: Vec<ZpoolName>,
dirs: Vec<Utf8PathBuf>,
}

async fn setup_storage() -> (StorageHandle, Vec<ZpoolName>) {
async fn setup_storage() -> StorageHandle {
let (mut manager, handle) = FakeStorageManager::new();

// Spawn the storage manager as done by sled-agent
Expand All @@ -1836,15 +1835,13 @@ mod illumos_tests {
});

// These must be internal zpools
let mut zpool_names = vec![];
for _ in 0..2 {
let internal_zpool_name = ZpoolName::new_internal(Uuid::new_v4());
let internal_disk: RawDisk =
SyntheticDisk::new(internal_zpool_name.clone()).into();
handle.upsert_disk(internal_disk).await;
zpool_names.push(internal_zpool_name);
}
(handle, zpool_names)
handle
}

impl ResourceWrapper {
Expand All @@ -1853,15 +1850,15 @@ mod illumos_tests {
async fn new() -> Self {
// Spawn the storage related tasks required for testing and insert
// synthetic disks.
let (storage_handle, zpool_names) = setup_storage().await;
let storage_handle = setup_storage().await;
let resources = storage_handle.get_latest_resources().await;
let dirs = resources.all_zone_bundle_directories();
for d in dirs.iter() {
let id =
d.components().nth(3).unwrap().as_str().parse().unwrap();
create_test_dataset(&id, d).await.unwrap();
}
Self { storage_handle, zpool_names, dirs }
Self { storage_handle, dirs }
}
}

Expand Down

0 comments on commit 91742c6

Please sign in to comment.