Skip to content

Commit

Permalink
nit: mock_device to mock_disk
Browse files Browse the repository at this point in the history
  • Loading branch information
papertigers committed Mar 11, 2024
1 parent 3010370 commit ea09e03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions sled-hardware/src/illumos/partitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ mod test {
use crate::DiskPaths;
use camino::Utf8PathBuf;
use illumos_utils::zpool::MockZpool;
use omicron_test_utils::dev::{mock_device_identity, test_setup_log};
use omicron_test_utils::dev::{mock_disk_identity, test_setup_log};
use std::path::Path;

struct FakePartition {
Expand Down Expand Up @@ -384,7 +384,7 @@ mod test {
&log,
&DiskPaths { devfs_path, dev_path: None },
DiskVariant::U2,
&mock_device_identity(),
&mock_disk_identity(),
);
match result {
Err(PooledDiskError::CannotFormatMissingDevPath { .. }) => {}
Expand Down Expand Up @@ -418,7 +418,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH)),
},
DiskVariant::U2,
&mock_device_identity(),
&mock_disk_identity(),
)
.expect("Should have succeeded partitioning disk");

Expand All @@ -443,7 +443,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH))
},
DiskVariant::M2,
&mock_device_identity(),
&mock_disk_identity(),
)
.is_err());

Expand Down Expand Up @@ -481,7 +481,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH)),
},
DiskVariant::U2,
&mock_device_identity(),
&mock_disk_identity(),
)
.expect("Should be able to parse disk");

Expand Down Expand Up @@ -524,7 +524,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH)),
},
DiskVariant::M2,
&mock_device_identity(),
&mock_disk_identity(),
)
.expect("Should be able to parse disk");

Expand Down Expand Up @@ -564,7 +564,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH)),
},
DiskVariant::M2,
&mock_device_identity(),
&mock_disk_identity(),
)
.expect_err("Should have failed parsing empty GPT"),
PooledDiskError::BadPartitionLayout { .. }
Expand All @@ -590,7 +590,7 @@ mod test {
dev_path: Some(Utf8PathBuf::from(DEV_PATH)),
},
DiskVariant::U2,
&mock_device_identity(),
&mock_disk_identity(),
)
.expect_err("Should have failed parsing empty GPT"),
PooledDiskError::BadPartitionLayout { .. }
Expand Down
2 changes: 1 addition & 1 deletion test-utils/src/dev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub fn process_running(pid: u32) -> bool {

/// Returns a DiskIdentity that can be passed to ensure_partition_layout when
/// not operating on a real disk.
pub fn mock_device_identity() -> DiskIdentity {
pub fn mock_disk_identity() -> DiskIdentity {
DiskIdentity {
vendor: "MockVendor".to_string(),
serial: "MOCKSERIAL".to_string(),
Expand Down

0 comments on commit ea09e03

Please sign in to comment.