Skip to content

e2e: add RFC-18 flex-algo end-to-end tests (RFC-18, PR 4/4)#3477

Draft
ben-malbeclabs wants to merge 3 commits intobc/rfc18-controllerfrom
bc/rfc18-e2e
Draft

e2e: add RFC-18 flex-algo end-to-end tests (RFC-18, PR 4/4)#3477
ben-malbeclabs wants to merge 3 commits intobc/rfc18-controllerfrom
bc/rfc18-e2e

Conversation

@ben-malbeclabs
Copy link
Copy Markdown
Contributor

@ben-malbeclabs ben-malbeclabs commented Apr 7, 2026

Summary of Changes

  • Adds five new end-to-end test functions covering the full RFC-18 operator workflow:
    • TestE2E_FlexAlgo_TopologyLifecycle — create a topology, tag a link, attempt delete (expect error), clear the topology, delete successfully
    • TestE2E_FlexAlgo_TopologyFilter — verify doublezero link list --topology <name> returns correct links before and after tagging; includes --topology default (untagged) and named topology cases
    • TestE2E_FlexAlgo_UnicastDrained — set and clear --unicast-drained on a link; poll the Go SDK to confirm link_flags bit 0 transitions correctly
    • TestE2E_FlexAlgo_TenantIncludeTopologies — set and clear --include-topologies on a tenant; poll SDK for field changes (lightweight devnet, activator disabled)
    • TestE2E_FlexAlgo_Migrate — clear topologies from a link, run doublezero-admin migrate flex-algo --dry-run (verify "DRY RUN" output and count), run live migrate, poll SDK to confirm link is re-tagged
  • Adds TestE2E_FlexAlgo_Controller — exercises controller config generation end-to-end with a live cEOS device
  • Updates TestE2E_LinkOnchainAllocation to create UNICAST-DEFAULT topology before link activation (now required by the program)
  • Adds --features-config plumbing to the devnet controller container and devnet.WithFeaturesConfig helper

Stacked PRs: This is PR 4/4. Depends on #3474 (smartcontract), #3475 (activator), and #3476 (controller). Merge last.

RFC: rfcs/rfc18-link-classification-flex-algo.md

Diff Breakdown

Category Files Lines (+/-) Net
Tests 6 +1,151 / -0 +1,151
Scaffolding 7 +60 / -7 +53

Entirely test additions plus the devnet infrastructure to support them.

Key files (click to expand)
  • e2e/topology_filter_test.go — 368 lines; validates --topology filter across create/tag/untag cycles
  • e2e/topology_lifecycle_test.go — 222 lines; verifies safe-delete enforcement (can't delete while links reference topology)
  • e2e/flex_algo_test.go — 231 lines; controller config generation test against live cEOS
  • e2e/topology_migrate_test.go — 191 lines; dry-run and live migrate with SDK polling
  • e2e/tenant_topology_test.go — 139 lines; lightweight devnet for tenant field changes
  • e2e/internal/devnet/controller.goWithFeaturesConfig devnet option for passing features.yaml to the controller container

Testing Verification

  • All six new test functions compile and are wired into the e2e suite
  • TestE2E_LinkOnchainAllocation updated to create UNICAST-DEFAULT first — verifies the existing link allocation flow still works after the activation constraint was added
  • Tests use Go SDK polling (not CLI output alone) to confirm onchain state transitions for link_flags, link_topologies, and include_topologies

@ben-malbeclabs ben-malbeclabs marked this pull request as draft April 8, 2026 18:18
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