Skip to content

Commit

Permalink
Merge pull request #3714 from bgurney-rh/stratis-min-tests-v
Browse files Browse the repository at this point in the history
Add stratis-min coverage tests for sim engine encrypted pools
  • Loading branch information
mulkieran authored Nov 4, 2024
2 parents fb9823f + 87ff24c commit d2bc129
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,61 @@ fn test_stratis_min_create_destroy() {
test_with_stratisd_min_sim(stratis_min_create_destroy);
}

fn stratis_min_create_encrypted_keydesc() {
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("--key-desc")
.arg("testkey")
.arg("pn")
.arg("/dev/n");
cmd.assert().success();
}

#[test]
fn test_stratis_min_create_encrypted_keydesc() {
test_with_stratisd_min_sim(stratis_min_create_encrypted_keydesc);
}

fn stratis_min_create_encrypted_keydesc_bind_clevis() {
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("--key-desc")
.arg("testkey")
.arg("pn")
.arg("/dev/n");
cmd.assert().success();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("bind")
.arg("tang")
.arg("--name")
.arg("pn")
.arg("url")
.arg("--trust-url");
cmd.assert().success();
}

#[test]
fn test_stratis_min_create_encrypted_keydesc_bind_clevis() {
test_with_stratisd_min_sim(stratis_min_create_encrypted_keydesc_bind_clevis);
}

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

0 comments on commit d2bc129

Please sign in to comment.