Refactor duplicated invalid host-service port assertions in host-access firewall tests#5350
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the host-access firewall unit tests to remove duplicated setup and assertions around invalid allowHostServicePorts values, keeping the security-sensitive “invalid ports must not produce iptables --dport rules” coverage consistent across related test cases.
Changes:
- Added a shared
setupHostAccessWithServicePorts()helper to centralize the common host-access test setup forallowHostServicePorts. - Added a shared
expectInvalidHostServicePortsSkipped()helper to consolidate negative assertions for invalid service ports. - Updated the two previously duplicated test cases to reuse these helpers and focus on their distinct expectations (default gateway HTTP rules still present; valid service port still allowed).
Show a summary per file
| File | Description |
|---|---|
src/host-iptables-host-access.test.ts |
Consolidates duplicated allowHostServicePorts setup and invalid-port iptables negative assertions into shared helpers, then updates the affected tests to use them. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
|
✅ Copilot review passed with no inline comments. @copilot Add the |
|
🔌 Smoke Services — All services reachable! ✅ |
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed... |
|
✅ Smoke Gemini completed. All facets verified. 💎 Smoke test completed with partial success. |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Claude passed |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Build Test Suite completed successfully! |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test: Claude Engine Validation
Overall Result: PASS
|
|
✅ Smoke Test: Copilot BYOK (Direct Mode)
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy sidecar)
|
🤖 Smoke Test Results — PASS
PR: Refactor duplicated invalid host-service port assertions in host-access firewall tests Overall: PASS
|
|
Split docker-manager cleanup tests by concern Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing
All 5 scenarios pass. OTEL tracing integration is fully operational.
|
|
cc Smoke Test Results:
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Overall: PASS
|
🧪 Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
🔬 Smoke Test: Copilot PAT — PASS
Auth mode: PAT (COPILOT_GITHUB_TOKEN) PR author:
|
Smoke Test Results
Overall: FAIL — Service containers are not reachable.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS Details
|
Smoke Test Results: Gemini Engine
Overall status: FAIL PR titles (partial):
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
The host-access firewall tests duplicated the same invalid
allowHostServicePortssetup and negativeiptablesassertions in two security-sensitive cases. This consolidates that coverage so the default-port and valid-service-port variants share the same invalid-port expectations.What changed
allowHostServicePorts.iptables --dportrules.Why this matters
Example