Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove last unnecessary dependency on BDA impl in tests in bda module #1663

Merged
merged 1 commit into from
Oct 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/engine/strat_engine/backstore/metadata/bda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,23 +569,16 @@ mod tests {
#[test]
/// Construct an arbitrary StaticHeader object.
/// Verify that the "memory buffer" is unowned.
/// Initialize a BDA.
/// Initialize a static header.
/// Verify that Stratis buffer validates.
/// Wipe the BDA.
/// Wipe the static header.
/// Verify that the buffer is again unowned.
fn test_ownership(ref sh in static_header_strategy()) {
let buf_size = *sh.mda_size.sectors().bytes() as usize + bytes!(static_header_size::STATIC_HEADER_SECTORS);
let mut buf = Cursor::new(vec![0; buf_size]);
prop_assert!(StaticHeader::setup(&mut buf).unwrap().is_none());

BDA::initialize(
&mut buf,
sh.pool_uuid,
sh.dev_uuid,
sh.mda_size.region_size().data_size(),
sh.blkdev_size,
Utc::now().timestamp() as u64,
).unwrap();
sh.write(&mut buf, MetadataLocation::Both).unwrap();

prop_assert!(StaticHeader::setup(&mut buf)
.unwrap()
Expand Down