Skip to content

Commit

Permalink
Merge pull request #3713 from bgurney-rh/stratis-min-tests-iv
Browse files Browse the repository at this point in the history
Add more stratis-min coverage tests
  • Loading branch information
mulkieran authored Oct 31, 2024
2 parents fd48484 + 38bd64c commit fb9823f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,64 @@ fn test_stratis_min_create_with_clevis_1() {
));
}

// Test parsing when creating a pool w/ clevis tang, and a URL.
fn stratis_min_create_with_clevis_url() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("create")
.arg("--clevis")
.arg("tang")
.arg("--tang-url")
.arg("url")
.arg("--trust-url")
.arg("pn")
.arg("/dev/n");
cmd.assert().success();
}

#[test]
fn test_stratis_min_create_with_clevis_url() {
test_with_stratisd_min_sim(stratis_min_create_with_clevis_url);
}

// Test parsing when creating a pool w/ clevis tang, and a thumbprint.
fn stratis_min_create_with_clevis_thumbprint() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("create")
.arg("--clevis")
.arg("tang")
.arg("--tang-url")
.arg("url")
.arg("--thumbprint")
.arg("jkj")
.arg("pn")
.arg("/dev/n");
cmd.assert().success();
}

#[test]
fn test_stratis_min_create_with_clevis_thumbprint() {
test_with_stratisd_min_sim(stratis_min_create_with_clevis_thumbprint);
}

// Test parsing when creating a pool w/ clevis TPM2.
fn stratis_min_create_with_clevis_tpm() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("pool")
.arg("create")
.arg("--clevis")
.arg("tpm2")
.arg("pn")
.arg("/dev/n");
cmd.assert().success();
}

#[test]
fn test_stratis_min_create_with_clevis_tpm() {
test_with_stratisd_min_sim(stratis_min_create_with_clevis_tpm);
}

#[test]
// Test parsing when creating a pool with an invalid Clevis method.
fn test_stratis_min_create_with_clevis_invalid() {
Expand Down

0 comments on commit fb9823f

Please sign in to comment.