Skip to content

Commit

Permalink
Exercise code path when --prompt and clevis specified
Browse files Browse the repository at this point in the history
Run a test to cover the error return when --prompt and
--unlock-method=clevis are specified.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jun 24, 2024
1 parent d917e2a commit 96a7903
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,23 @@ fn test_stratis_min_create_no_blockdevs() {
));
}

#[test]
// Test starting a pool using both a prompt and an unlock method of clevis.
fn test_stratis_min_pool_start_invalid_arg_combination() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("start")
.arg("--name")
.arg("pn")
.arg("--unlock-method")
.arg("clevis")
.arg("--prompt");
cmd.assert()
.failure()
.code(1)
.stderr(predicate::str::contains("mutually exclusive"));
}

#[test]
// Test stopping a pool using an invalid UUID; unless name is specified the
// id value is interpreted as a UUID.
Expand Down

0 comments on commit 96a7903

Please sign in to comment.