Skip to content

test(tools): add execute_confirmed + blocklist regression test#1623

Merged
bug-ops merged 1 commit intomainfrom
test-tools-add-execute-confirm
Mar 13, 2026
Merged

test(tools): add execute_confirmed + blocklist regression test#1623
bug-ops merged 1 commit intomainfrom
test-tools-add-execute-confirm

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 13, 2026

Summary

  • Adds execute_confirmed_blocked_command_rejected test in crates/zeph-tools/src/shell.rs
  • Uses sudo id (blocklist-only, no confirm-pattern overlap) to unambiguously assert ToolError::Blocked is returned when calling execute_confirmed() with a blocked command
  • Covers the code path verified in fix(tools): enforce shell blocklist before permission policy check #1529 where find_blocked_command() runs before the skip_confirm guard

Closes #1530.

Test plan

  • cargo nextest run -p zeph-tools --lib — 657 tests pass
  • cargo +nightly fmt --check — OK
  • cargo clippy --workspace --features full -- -D warnings — no warnings
  • Full suite: cargo nextest run --workspace --features full --lib --bins — 5182 tests pass

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes tests Test-related changes size/S Small PR (11-50 lines) labels Mar 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 13, 2026 15:22
Asserts that execute_confirmed() with a blocklisted command returns
ToolError::Blocked, covering the code path verified in #1529.

Closes #1530.
@bug-ops bug-ops force-pushed the test-tools-add-execute-confirm branch from 1d1354b to e074d0a Compare March 13, 2026 15:38
@github-actions github-actions bot added tests Test-related changes and removed tests Test-related changes labels Mar 13, 2026
@bug-ops bug-ops merged commit 9df4140 into main Mar 13, 2026
15 checks passed
@bug-ops bug-ops deleted the test-tools-add-execute-confirm branch March 13, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(tools): add execute_confirmed + blocklist regression test

1 participant