From 7a9e29fc81b6a65929d4978cdcbf564953f662f1 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 8 Apr 2024 13:24:17 -0400 Subject: [PATCH] Add test_stratis_min_pool_stop_invalid_name Signed-off-by: Bryan Gurney --- tests/stratis_min.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/stratis_min.rs b/tests/stratis_min.rs index 9bfbf49894f..b1215dc1d45 100644 --- a/tests/stratis_min.rs +++ b/tests/stratis_min.rs @@ -214,6 +214,22 @@ fn test_stratis_min_pool_rename() { test_with_stratisd_min_sim(stratis_min_pool_rename); } +#[test] +// Test stopping a pool using an invalid name, that will fail with a +// "Uuid error". +fn 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")); +} + +#[test] +fn test_stratis_min_pool_stop_invalid_name() { + test_with_stratisd_min_sim(stratis_min_pool_stop_invalid_name); +} + fn stratis_min_report() { let mut cmd = Command::cargo_bin("stratis-min").unwrap(); cmd.arg("report");