Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression test for key set in stratis-min #3591

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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\n")
.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);
}
Loading