Skip to content

Commit

Permalink
Regression test for key set in stratis-min
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaublitz committed Apr 3, 2024
1 parent 6b304b3 commit 9a39190
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ test-clevis-loop-should-fail-valgrind:

## Test stratisd-min CLI
test-stratisd-min:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test --no-default-features --features "engine,min" test_stratisd_min
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test --no-default-features --features "engine,min" test_stratisd_min

## Test stratis-min CLI
test-stratis-min:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test --no-default-features --features "engine,min" test_stratis_min
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test --no-default-features --features "engine,min" test_stratis_min

## Run yamllint on workflow files
yamllint:
Expand Down
18 changes: 18 additions & 0 deletions tests/stratis_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,21 @@ fn stratis_min_list_default() {
fn test_stratis_min_list_defaults() {
test_with_stratisd_min_sim(stratis_min_list_default);
}

fn stratis_min_key_set() {
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.write_stdin("thisisatestpassphrase\nthisisatestpassphrase\n");
cmd.arg("key")
.arg("set")
.arg("--capture-key")
.arg("testkey");
cmd.assert().success();
let mut cmd = Command::cargo_bin("stratis-min").unwrap();
cmd.arg("key").arg("unset").arg("testkey");
cmd.assert().success();
}

#[test]
fn test_stratis_min_key_set() {
test_with_stratisd_min_sim(stratis_min_key_set);
}

0 comments on commit 9a39190

Please sign in to comment.