Skip to content

Commit

Permalink
Add test_stratis_min_create_pool_encrypted_rebind
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 10, 2024
1 parent 7834f80 commit 4751ec3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,46 @@ fn test_stratis_min_destroy_with_fs() {
test_with_stratisd_min_sim(stratis_min_destroy_with_fs);
}

fn stratis_min_create_pool_encrypted_rebind() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.write_stdin("thisisatestpassphrase\n")
.arg("key")
.arg("set")
.arg("--capture-key")
.arg("testkey");
cmd.assert().success();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("create")
.arg("pn")
.arg("/dev/n")
.arg("--key-desc")
.arg("testkey");
cmd.assert().success();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.write_stdin("thisisanothertestpassphrase\n")
.arg("key")
.arg("set")
.arg("--capture-key")
.arg("testkey2");
cmd.assert().success();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("rebind")
.arg("keyring")
.arg("--name")
.arg("pn")
.arg("--key-desc")
.arg("testkey2");
cmd.assert().success();
}

#[test]
// Test creating an encrypted pool.
fn test_stratis_min_create_pool_encrypted_rebind() {
test_with_stratisd_min_sim(stratis_min_create_pool_encrypted_rebind);
}

fn stratis_min_pool_rename() {
stratis_min_create_pool_and_fs();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
Expand Down

0 comments on commit 4751ec3

Please sign in to comment.