Skip to content

test: add access control tests and fix exec fallthrough#57

Draft
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/test-infrastructure-hardening
Draft

test: add access control tests and fix exec fallthrough#57
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/test-infrastructure-hardening

Conversation

@toddr-bot
Copy link
Copy Markdown

@toddr-bot toddr-bot commented Apr 8, 2026

What

Add dedicated tests for the Accept() access control logic, fix an exec-without-die
bug in Test.pm, and remove a stale test dependency.

Why

Accept()'s client/mask matching is the module's security gate — IP allow/deny rules
determine which clients can connect. This logic had zero dedicated test coverage.
The exec bug meant a failed server spawn in Child() would silently create a zombie
parent process instead of failing visibly.

How

  • t/accept.t (13 tests): Uses a MockSocket to unit-test Accept() directly.
    Covers: allow/deny masks, first-match semantics, arrayref masks, unconditional
    entries (no mask), default deny, and unix socket client resolution (localhost/127.0.0.1).
  • Test.pm: Added die "exec failed: $!" after exec @_ in Child() fork path.
  • cpanfile: Removed Test dependency — all test files use Test::More since the
    test modernization PRs.

Testing

Full test suite passes (20 test files). New t/accept.t: 13/13 pass.

🤖 Generated with Claude Code


Quality Report

Changes: 4 files changed, 173 insertions(+), 1 deletion(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

- Add t/accept.t with 13 tests covering Accept() access control logic:
  allow/deny masks, first-match semantics, arrayref masks, unconditional
  entries, default deny, and unix socket client resolution.
- Fix exec-without-die in Test.pm Child(): if exec fails, the forked
  child now dies instead of silently falling through as a second parent.
- Remove stale 'Test' dependency from cpanfile — all tests use Test::More.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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