Skip to content

Commit

Permalink
Switch unit tests for rollback on failing devices to use start/stop p…
Browse files Browse the repository at this point in the history
…ool funcionality
  • Loading branch information
jbaublitz committed Apr 18, 2022
1 parent baea8f7 commit 0e04bcf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/engine/strat_engine/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ mod test {
strat_engine::{
backstore::crypt_metadata_size,
cmd,
tests::{crypt, dm_stratis_devices_remove, loopbacked, real, FailDevice},
tests::{crypt, loopbacked, real, FailDevice},
udev::{CRYPTO_FS_TYPE, FS_TYPE_KEY},
},
types::{
Expand Down Expand Up @@ -794,7 +794,7 @@ mod test {
F: Fn(&mut StratPool) -> Result<(), Box<dyn Error>>,
{
fn needs_clean_up<F>(
engine: StratEngine,
engine: &StratEngine,
uuid: PoolUuid,
fail_device: &FailDevice,
operation: F,
Expand Down Expand Up @@ -824,8 +824,6 @@ mod test {

fail_device.stop_failing()?;

engine.teardown()?;

Ok(())
}

Expand Down Expand Up @@ -873,13 +871,12 @@ mod test {

test_async!(engine.handle_events(events));

let res = needs_clean_up(engine, uuid, fail_device, operation);
let res = needs_clean_up(&engine, uuid, fail_device, operation);

dm_stratis_devices_remove()?;
test_async!(engine.stop_pool(uuid))?;
res?;

let engine = StratEngine::initialize()?;
test_async!(engine.unlock_pool(uuid, unlock_method))?;
test_async!(engine.start_pool(uuid, Some(unlock_method)))?;
test_async!(engine.destroy_pool(uuid))?;
engine.teardown()?;

Expand Down

0 comments on commit 0e04bcf

Please sign in to comment.