diff --git a/tests/stratis_min.rs b/tests/stratis_min.rs index 9bfbf49894f..666f18013a2 100644 --- a/tests/stratis_min.rs +++ b/tests/stratis_min.rs @@ -214,6 +214,30 @@ fn test_stratis_min_pool_rename() { test_with_stratisd_min_sim(stratis_min_pool_rename); } +fn stratis_min_pool_stop_name() { + stratis_min_create_pool_and_fs(); + let mut cmd = Command::cargo_bin("stratis-min").unwrap(); + cmd.arg("pool").arg("stop").arg("--name").arg("pn"); + cmd.assert().success(); +} + +#[test] +// Test stopping a pool using a valid name. +fn test_stratis_min_pool_stop_name() { + test_with_stratisd_min_sim(stratis_min_pool_stop_name); +} + +#[test] +// Test stopping a pool using an invalid name, that will fail with a +// "Uuid error". +fn test_stratis_min_pool_stop_invalid_name() { + let mut cmd = Command::cargo_bin("stratis-min").unwrap(); + cmd.arg("pool").arg("stop").arg("pn"); + cmd.assert() + .failure() + .stderr(predicate::str::contains("Uuid error")); +} + fn stratis_min_report() { let mut cmd = Command::cargo_bin("stratis-min").unwrap(); cmd.arg("report");