Skip to content

Commit

Permalink
Add stratis-min pool stop tests for stopping by name
Browse files Browse the repository at this point in the history
Signed-off-by: Bryan Gurney <[email protected]>
  • Loading branch information
bgurney-rh committed Apr 8, 2024
1 parent 922b85c commit f382e6a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f382e6a

Please sign in to comment.