From 30dc96f750537add914268b67a83e548d3f3d928 Mon Sep 17 00:00:00 2001 From: mulhern Date: Thu, 17 Oct 2019 09:21:19 -0400 Subject: [PATCH] Remove last unnecessary dependency on BDA impl in tests in bda module 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 --- src/engine/strat_engine/backstore/metadata/bda.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/engine/strat_engine/backstore/metadata/bda.rs b/src/engine/strat_engine/backstore/metadata/bda.rs index eaa3ba123d..069deb390b 100644 --- a/src/engine/strat_engine/backstore/metadata/bda.rs +++ b/src/engine/strat_engine/backstore/metadata/bda.rs @@ -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()