Skip to content

Gateway ACL release-tests - #1874

Closed
edipascale wants to merge 2 commits into
ema/multiple-conns-unbundledfrom
ema/prepare-acl-rts
Closed

Gateway ACL release-tests#1874
edipascale wants to merge 2 commits into
ema/multiple-conns-unbundledfrom
ema/prepare-acl-rts

Conversation

@edipascale

@edipascale edipascale commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fix #1873

@edipascale edipascale added ci:-vlab Disable VLAB tests ci:-upgrade Disable VLAB upgrade tests labels Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f63bfff3-92c0-45c3-bedf-1ecdfe05752f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

The connectivity matrix now supports protocol/port-scoped expectations and probes. TCP and UDP reachability checks were added, with on-demand iperf3 listeners. Gateway peering ACL options and release tests cover multiple ACL behaviors.

Gateway ACL connectivity

Layer / File(s) Summary
Protocol-scoped matrix contracts
pkg/hhfab/matrix.go, pkg/hhfab/rt_nat_tests.go, pkg/hhfab/matrix_test.go
Matrix helpers enumerate sorted non-default protocol/port expectations, while verdict helpers and tests preserve scoped metadata.
TCP and UDP reachability probes
pkg/hhfab/testing.go
TCP uses netcat connection checks; UDP uses iperf3 loss reporting and extended JSON fields.
Protocol-scoped matrix execution
pkg/hhfab/matrix.go
Matrix execution starts required listeners, runs ICMP/TCP/UDP probes, applies destination NAT retargeting, and skips duplicate default probes.
Gateway peering ACL test coverage
pkg/hhfab/rt_utils.go, pkg/hhfab/rt_acl_tests.go, pkg/hhfab/rt_multi_vpc_single_subnet_suite.go
Peering specs accept ACLs, and the suite registers tests for default behavior, scope, ports, directions, flow handling, and rule precedence.

Possibly related issues

  • Issue 1873 — Directly requests release-test coverage for the new gateway ACL behavior implemented here.

Possibly related PRs

Suggested reviewers: pau-hedgehog, frostman

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add gateway peering ACL release tests and supporting connectivity probes, matching issue #1873.
Out of Scope Changes check ✅ Passed All added infrastructure and tests support the gateway ACL release-test scope; no unrelated changes stand out.
Title check ✅ Passed The title clearly summarizes the main change: adding gateway ACL release tests.
Description check ✅ Passed The description references the tracked issue addressed by this changeset.

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new set of “release-tests” that encode the intended behavior for gateway peering ACLs (expected to fail until dataplane enforcement is implemented), and extends the matrix-driven connectivity runner to probe protocol/port–scoped expectations.

Changes:

  • Introduces protocol/port–scoped matrix expectations and a dedicated probe phase (ICMP ping, TCP connect, UDP iperf3-loss) including on-demand iperf3 listeners for non-5201 ports.
  • Extends gateway peering spec helpers to accept an optional peering-scoped ACL and adds a new ACL-focused runtime test suite file wired into the multi-VPC single-subnet suite.
  • Extends iperf3 JSON parsing structs to support UDP summary fields used by the new UDP probe.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/hhfab/testing.go Adds TCP/UDP port probes and extends iperf3 JSON parsing to support UDP loss-based reachability checks.
pkg/hhfab/rt_utils.go Adds optional ACL field to gateway peering options and plumbs it into the generated peering spec.
pkg/hhfab/rt_nat_tests.go Adds helper to set per-protocol/per-port verdicts in the connectivity matrix.
pkg/hhfab/rt_multi_vpc_single_subnet_suite.go Registers the new gateway peering ACL test cases into the suite.
pkg/hhfab/rt_acl_tests.go New ACL release-tests covering default actions, protocol/port scoping, directionality (packet vs flow), subnet scoping, and rule precedence.
pkg/hhfab/matrix.go Adds proto/port-scoped entry enumeration, listener management, and a dedicated proto/port probe phase to the matrix runner.
pkg/hhfab/matrix_test.go New unit tests covering proto/port entry sorting/filtering and proto verdict overlay behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/hhfab/rt_nat_tests.go
Comment thread pkg/hhfab/matrix.go
Comment thread pkg/hhfab/matrix.go
Comment thread pkg/hhfab/rt_acl_tests.go Outdated
Comment thread pkg/hhfab/rt_acl_tests.go
Comment thread pkg/hhfab/rt_acl_tests.go
@edipascale
edipascale force-pushed the ema/prepare-acl-rts branch from a370583 to f2e846b Compare July 15, 2026 09:20
@edipascale

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/hhfab/matrix.go`:
- Around line 765-785: Update the protocol dispatch around checkPing,
checkTCPPort, and checkUDPPort to honor the individual enablement options: run
ICMP only when opts.PingsCount > 0, and run TCP/UDP only when opts.IPerfsSeconds
> 0. Apply the same guards to the corresponding listener startup paths
referenced by the review so L4 listeners are created only for enabled probes.

In `@pkg/hhfab/rt_acl_tests.go`:
- Around line 359-370: Update every ACL test registration returned by
getACLTestCases to include NoServers: true alongside NoGateway: true in
SkipFlags. Preserve the existing test functions, names, and NoGateway behavior
while ensuring all server-dependent connectivity probes are skipped for
no-server topologies.

In `@pkg/hhfab/testing.go`:
- Around line 3385-3399: Update the TCP probe logic around retrySSHCmd so deny
assertions pass only for a valid refused or timed-out connection, not SSH,
Docker, or probe execution failures; surface infrastructure errors instead. In
pkg/hhfab/testing.go lines 3385-3399, distinguish command execution errors from
expected connection failures. In pkg/hhfab/testing.go lines 3444-3489, restrict
blocked-UDP classification to validated control-channel denial, zero datagrams,
or near-total packet loss, and do not treat arbitrary command or JSON parse
errors as blocked traffic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 285748a3-21ea-477b-8cab-e4093ab0429b

📥 Commits

Reviewing files that changed from the base of the PR and between d99cb50 and f2e846b.

📒 Files selected for processing (7)
  • pkg/hhfab/matrix.go
  • pkg/hhfab/matrix_test.go
  • pkg/hhfab/rt_acl_tests.go
  • pkg/hhfab/rt_multi_vpc_single_subnet_suite.go
  • pkg/hhfab/rt_nat_tests.go
  • pkg/hhfab/rt_utils.go
  • pkg/hhfab/testing.go

Comment thread pkg/hhfab/matrix.go
Comment thread pkg/hhfab/rt_acl_tests.go Outdated
Comment thread pkg/hhfab/testing.go Outdated
@edipascale
edipascale force-pushed the ema/prepare-acl-rts branch from f2e846b to 6a90d16 Compare July 15, 2026 09:54
@edipascale
edipascale force-pushed the ema/multiple-conns-unbundled branch from d99cb50 to 340084b Compare July 15, 2026 09:59
@edipascale
edipascale force-pushed the ema/prepare-acl-rts branch from 6a90d16 to e40a803 Compare July 15, 2026 09:59
@edipascale
edipascale force-pushed the ema/multiple-conns-unbundled branch from 340084b to c430b6d Compare July 22, 2026 06:46
@edipascale
edipascale force-pushed the ema/prepare-acl-rts branch 3 times, most recently from 37eb8f2 to 0051511 Compare July 22, 2026 10:49
@edipascale

Copy link
Copy Markdown
Contributor Author

Tested with https://github.com/githedgehog/dataplane/pkgs/container/dataplane/1053558225?tag=v0-8d6531066

results of a vlab release-test run with regex "Gateway Peering":

13:26:37 INF *** Recap of the test results ***
13:26:37 INF Test suite results suite="No VPCs Suite"
13:26:37 WRN SKIP test="Breakout ports" reason="Regex selection"
13:26:37 WRN SKIP test="Loki Observability" reason="Regex selection"
13:26:37 WRN SKIP test="Prometheus Observability" reason="Regex selection"
13:26:37 INF Test suite summary tests=3 passed=0 skipped=3 failed=0 duration=0s
13:26:37 INF Test suite results suite="Single VPC Suite"
13:26:37 WRN SKIP test="No restrictions" reason="Regex selection"
13:26:37 WRN SKIP test="Single VPC with restrictions" reason="Regex selection"
13:26:37 WRN SKIP test="DNS/NTP/MTU/DHCP lease" reason="Regex selection"
13:26:37 WRN SKIP test="DHCP renewal" reason="Regex selection"
13:26:37 WRN SKIP test="DHCP static lease" reason="Regex selection"
13:26:37 WRN SKIP test="MCLAG Failover" reason="Regex selection"
13:26:37 WRN SKIP test="ESLAG Failover" reason="Regex selection"
13:26:37 WRN SKIP test="ESLAG Fallback" reason="Regex selection"
13:26:37 WRN SKIP test="Bundled Failover" reason="Regex selection"
13:26:37 WRN SKIP test="Spine Failover" reason="Regex selection"
13:26:37 WRN SKIP test="Mesh Failover" reason="Regex selection"
13:26:37 WRN SKIP test="RoCE flag and basic traffic marking" reason="Regex selection"
13:26:37 INF Test suite summary tests=12 passed=0 skipped=12 failed=0 duration=0s
13:26:37 INF Test suite results suite="Multi-Subnet Multi-VPC Suite"
13:26:37 WRN SKIP test="Multi-Subnets no restrictions" reason="Regex selection"
13:26:37 WRN SKIP test="Multi-Subnets isolation" reason="Regex selection"
13:26:37 WRN SKIP test="Multi-Subnets with filtering" reason="Regex selection"
13:26:37 WRN SKIP test=StaticExternal reason="Regex selection"
13:26:37 INF Test suite summary tests=4 passed=0 skipped=4 failed=0 duration=0s
13:26:37 INF Test suite results suite="Multi-VPC Single-Subnet Suite"
13:26:37 WRN SKIP test="Starter Test" reason="Regex selection"
13:26:37 WRN SKIP test="Only Externals" reason="Regex selection"
13:26:37 WRN SKIP test="Full Mesh All Externals" reason="Regex selection"
13:26:37 WRN SKIP test="Full Loop All Externals" reason="Regex selection"
13:26:37 WRN SKIP test="Sergei's Special Test" reason="Regex selection"
13:26:37 INF PASS test="Gateway Peering"
13:26:37 WRN SKIP test="Gateway Failover" reason="Regex selection"
13:26:37 INF PASS test="Gateway Peering Loop"
13:26:37 INF PASS test="Mixed VPC and Gateway Peering Loop"
13:26:37 WRN SKIP test="Mixed Gateway and Fabric External Peering" reason="Regex selection"
13:26:37 WRN SKIP test="Static External Peering" reason="Regex selection"
13:26:37 INF PASS test="Gateway Peering Masquerade Source NAT"
13:26:37 INF PASS test="Gateway Peering Static Source NAT"
13:26:37 INF PASS test="Gateway Peering Bidirectional Static NAT"
13:26:37 INF PASS test="Gateway Peering Overlap NAT"
13:26:37 INF PASS test="Gateway Peering Port Forward NAT"
13:26:37 INF PASS test="Gateway Peering Masquerade and Port Forward NAT"
13:26:37 WRN SKIP test="Gateway Peering BGP External No NAT" reason="There are no viable externals"
13:26:37 WRN SKIP test="Gateway Peering BGP External Static NAT" reason="There are no viable externals"
13:26:37 WRN SKIP test="Gateway Peering BGP External Masquerade NAT" reason="There are no viable externals"
13:26:37 WRN SKIP test="Gateway Peering BGP External Port Forward NAT" reason="There are no viable externals"
13:26:37 WRN SKIP test="Gateway Peering BGP External Masquerade and Port Forward NAT" reason="There are no viable externals"
13:26:37 INF PASS test="Gateway Peering Static External No NAT"
13:26:37 INF PASS test="Gateway Peering Static External Static NAT"
13:26:37 INF PASS test="Gateway Peering Static External Masquerade NAT"
13:26:37 INF PASS test="Gateway Peering Static External Port Forward NAT"
13:26:37 INF PASS test="Gateway Peering Static External Masquerade and Port Forward NAT"
13:26:37 INF PASS test="Gateway Peering ACL Default Deny"
13:26:37 INF PASS test="Gateway Peering ACL Deny-Unless-Exposed UDP Carve-Out"
13:26:37 INF PASS test="Gateway Peering ACL Explicit Allow"
13:26:37 INF PASS test="Gateway Peering ACL Protocol Scoping"
13:26:37 INF PASS test="Gateway Peering ACL Packet One-Way"
13:26:37 INF PASS test="Gateway Peering ACL Flow Scope Masquerade"
13:26:37 INF PASS test="Gateway Peering ACL Subnet/CIDR Scoping"
13:26:37 INF PASS test="Gateway Peering ACL Port Range Scoping"
13:26:37 INF PASS test="Gateway Peering ACL Precedence Allow-Then-Deny"
13:26:37 INF PASS test="Gateway Peering ACL Precedence Deny-Then-Allow"
13:26:37 INF Test suite summary tests=37 passed=24 skipped=13 failed=0 duration=35m52s
13:26:37 INF All tests completed duration=35m53.374265945s

@edipascale
edipascale force-pushed the ema/multiple-conns-unbundled branch from c430b6d to ef68a37 Compare July 28, 2026 14:43
edipascale and others added 2 commits July 28, 2026 16:43
The ConnectivityMatrix's ProtoPort field was unused scaffolding: the
runner only ever probed ICMP (ping), TCP iperf3 on port 5201, and curl,
and every Lookup passed the zero ProtoPort. Gateway peering ACLs need
per-protocol/per-port verdicts on the same endpoint pair (e.g. TCP allow
+ UDP deny), which the single default verdict cannot express.

Plumb ProtoPort end to end:
- ProtoPortEntries/HasProtoPortEntries accessors.
- runMatrixProtoPortPhase probes each non-zero ProtoPort entry (icmp via
  ping, tcp via nc, udp via iperf3 -u with loss parsing); the legacy
  server-server phase skips proto-scoped pairs so the two are disjoint.
- On-demand iperf3 listeners for arbitrary (non-5201) ports.
- checkTCPPort/checkUDPPort probes with no throughput floor.
- setVPCToVPCProtoVerdict overlay helper for tests.

Infra only; the ACL spec builder and ACL tests come next.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
Add GwPeeringOptions.ACL so a PeeringACL can be attached to a gateway
peering spec, and a rt_acl_tests.go suite exercising ACLs in isolation
on the multi-VPC single-subnet suite, built on the ProtoPort matrix
infra: default deny, deny-unless-exposed baseline, explicit allow,
protocol scoping, direction (packet) scoping, flow scope opening the
reverse direction, subnet scoping, arbitrary-port scoping, and two
rule-precedence cases.

Directional/precedence cases use packet scope to isolate the direction
under test; a dedicated flow-scope case asserts the stateful reverse.
These encode the intended behavior ahead of the dataplane ACL
implementation, so they are expected to fail until enforcement lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
@edipascale
edipascale force-pushed the ema/prepare-acl-rts branch from 0051511 to 78897bf Compare July 28, 2026 14:43
@edipascale edipascale added ci:+release Enable VLAB release tests ci:+hlab Enable hybrid VLAB tests and removed ci:-vlab Disable VLAB tests labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown

Release Tests

  6 files   24 suites   3h 28m 32s ⏱️
 56 tests  53 ✅   3 💤 0 ❌
336 runs  179 ✅ 157 💤 0 ❌

Results for commit 78897bf.

@edipascale
edipascale marked this pull request as ready for review July 29, 2026 06:13
@edipascale
edipascale requested review from a team as code owners July 29, 2026 06:13
@edipascale

Copy link
Copy Markdown
Contributor Author

closing in favor of #1910

@edipascale edipascale closed this Jul 30, 2026
@edipascale
edipascale deleted the ema/prepare-acl-rts branch September 1, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:-upgrade Disable VLAB upgrade tests ci:+hlab Enable hybrid VLAB tests ci:+release Enable VLAB release tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants