Skip to content

Commit

Permalink
Remove last unnecessary dependency on BDA impl in tests in bda module
Browse files Browse the repository at this point in the history
This will ease splitting out the static_header module, which should
only have the StaticHeader parts, but should include all the
StaticHeader-specific tests.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Oct 17, 2019
1 parent 7c19234 commit 30dc96f
Showing 1 changed file with 3 additions and 10 deletions.
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

0 comments on commit 30dc96f

Please sign in to comment.