Skip to content

test: accept PTY deny phrasing in Dockerfile.test shim assertion#232

Merged
erans merged 1 commit intomainfrom
fix-dockerfile-test-deny-msg
Apr 15, 2026
Merged

test: accept PTY deny phrasing in Dockerfile.test shim assertion#232
erans merged 1 commit intomainfrom
fix-dockerfile-test-deny-msg

Conversation

@erans
Copy link
Copy Markdown
Collaborator

@erans erans commented Apr 15, 2026

Summary

  • Widen the shim + policy integration case pattern in all six Dockerfile.test* variants to accept both denied by policy (PTY path, internal/cli/exec_pty.go) and blocked by policy (non-PTY path, internal/cli/exec.go).
  • Keeps the rc != 0 guard so a regression that prints the denial but returns success still fails the test.
  • Rewords the accompanying comment and fail messages to reflect both code paths.

This unblocks the rc4 release test — the alpine job failed with the shim printing command denied by policy while the test looked for blocked by policy.

Test plan

  • All six variants updated identically (grep confirms the new case pattern)
  • rc5 tag: release workflow passes Dockerfile.test integration across all six variants

🤖 Generated with Claude Code

The shim routes through the PTY code path (internal/cli/exec_pty.go),
which emits `agentsh: command denied by policy (rule=...)`, while the
non-PTY path in internal/cli/exec.go emits `blocked by policy`. The
Dockerfile.test* variants only matched the non-PTY phrasing, so the
shim+policy integration check has been failing in every release since
the PTY path became the default for shim invocations (observed on
v0.19.0-rc4 release run 24468579949, 45/46 passed, alpine variant).

Widen the case pattern to accept either phrasing, update the
accompanying comment to document both paths, and keep the rc != 0
guard that requires the denial to actually take effect.

Applied identically to all six Dockerfile.test* variants.
@erans erans merged commit b064a7c into main Apr 15, 2026
@erans erans deleted the fix-dockerfile-test-deny-msg branch April 15, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant