You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A. Explicit port-22 negative regression guard
- TestRequiredPorts_ConfDDoesNotIncludeSSHPort22: dedicated test
proving DirectAdmin RequiredPorts (TCP_IN + UDP_IN) does NOT
include port 22. Independent of full-surface identity test so a
future conf.d edit re-introducing 22 trips a clearly-named
failure. Comment cites the four-truth rule (conf.d wins, SSH
managed by /etc/nftban/ports.d/00-ssh.conf, shell-library port
22 inclusion is stale).
B. Fail-closed branches — no fallback to [2222] under any error
- assertNoControlPlaneFallback test helper added.
- TestRequiredPorts_MissingConfD_FailsClosed: now also asserts
returned tcp/udp slices are nil/empty (no [2222] fallback).
- TestRequiredPorts_EmptyTCPIn_FailsClosed: same.
- TestRequiredPorts_NilPanelConfig_FailsClosed: same.
- TestRequiredPorts_RealLoader_MissingConfD_FailsClosed (was
already present; the structural shape of fail-closed is now
covered uniformly).
C. Range-form (35000-35999) regression guard
- TestRequiredPorts_RealLoader_RangeExpansion_LengthAndEndpoints:
fixture conf.d with the canonical TCP_IN; asserts EXACT length
14 + 1000 = 1014, both endpoints (35000 and 35999) present, a
mid-range port (35500) present, every discrete declared port
present, and SSH 22 still excluded. Catches a future loader
change that drops range expansion or shifts the boundary.
D. Removed stale "PR26.4 follow-up" doc-comment from
ValidateReachability — replaced with PR26.4-current text noting
that RequiredPorts now loads the full conf.d surface but
ValidateReachability still probes only the control plane. The
ValidateReachability error message no longer says "validated in
PR26.4"; new wording: "loaded from conf.d via RequiredPorts but
not probed here".
E. Renamed misleading test
TestFrameworkIntegration_DA_Reason_DoesNotImplyFullPortSurvival
→
TestFrameworkIntegration_DA_ControlPlaneError_DoesNotClaimFullSurfaceReachability
The semantic is unchanged (control-plane error must not claim
full-surface probing), but the name now reflects post-PR26.4
reality where RequiredPorts does load the full surface declaratively.
No production code paths changed beyond the doc-comment + error
wording. All test additions/changes are test-file only.
Lab4 proof (post A–E, base 5366caf):
go vet ... clean
go test -v panelfw/ports/validate 100 sub-tests PASS, 0 FAIL
go test ./... 66 packages PASS, 0 FAIL
Hard exclusions preserved: no cPanel/Plesk/other adapters; no shell
decommission; no parser rewrite; no restore/firewall/authority
changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments