From f382e6aa72cdd34271c2d76c36bf6dc7c0fcd614 Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Mon, 8 Apr 2024 13:24:17 -0400 Subject: [PATCH] Add stratis-min pool stop tests for stopping by name Signed-off-by: Bryan Gurney --- tests/stratis_min.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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");