From 994ddae52b9529242b7c2609fc2153f7e21a4d1f Mon Sep 17 00:00:00 2001 From: Bryan Gurney Date: Fri, 5 Jul 2024 16:05:29 -0400 Subject: [PATCH] Add test_stratis_min_pool_start_invalid_unlock_method() Signed-off-by: Bryan Gurney --- tests/stratis_min.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/stratis_min.rs b/tests/stratis_min.rs index bf306c27fb..d942f5481e 100644 --- a/tests/stratis_min.rs +++ b/tests/stratis_min.rs @@ -187,6 +187,23 @@ fn test_stratis_min_pool_start_invalid_uuid() { .stderr(predicate::str::contains("Uuid error")); } +#[test] +// Test starting a pool using an invalid unlock method. +fn test_stratis_min_pool_start_invalid_unlock_method() { + let mut cmd = Command::cargo_bin("stratis-min").unwrap(); + cmd.arg("pool") + .arg("start") + .arg("--name") + .arg("pn") + .arg("--unlock-method=bogus"); + cmd.assert() + .failure() + .code(1) + .stderr(predicate::str::contains( + "bogus is an invalid unlock method", + )); +} + #[test] // Test binding a pool using an invalid UUID; unless name is specified the // id value is interpreted as a UUID.