Skip to content

Commit

Permalink
Merge pull request #1663 from mulkieran/master-test-cleanup
Browse files Browse the repository at this point in the history
Remove last unnecessary dependency on BDA impl in tests in bda module
  • Loading branch information
mulkieran authored Oct 17, 2019
2 parents 7c19234 + 30dc96f commit f0356eb
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 f0356eb

Please sign in to comment.