Repository navigation
Labels
galactic-edgeRelated to galactic-edgetech-debtInternal quality/maintenance: unwind shortcuts, config drift, overdue upgrades, fork/dep hygiene
Description
Summary
The admission tests for capability versions take the expected versions from the list they test, so they do not pin the contract. If that list lost PrefixReachability/v1 by mistake, admission would refuse a supported version and TestAdmitCapabilityVersions would still pass, because it derives what should be admitted from the same list:
galactic/internal/edge/admission/admission_test.go
Lines 181 to 206 in b00948a
| func TestAdmitCapabilityVersions(t *testing.T) { | |
| // A capability version the provider declares is still refused unless | |
| // core implements it, and every version core implements is admitted. | |
| providers := registry() | |
| p := providers[connectIP] | |
| p.Capabilities = append(slices.Clone(supportedCapabilities), Capability{Name: packetAccess, Version: "v9"}) | |
| providers[connectIP] = p | |
| g := grant() | |
| g.Capabilities = nil | |
| for _, c := range p.Capabilities { | |
| if !slices.Contains(g.Capabilities, c.Name) { | |
| g.Capabilities = append(g.Capabilities, c.Name) | |
| } | |
| } | |
| for _, c := range p.Capabilities { | |
| req := request() | |
| req.Capabilities = []Capability{c} | |
| d := Admit(providers, grants(g), req, epoch, maxSkew) | |
| if want := slices.Contains(supportedCapabilities, c); d.Admitted != want { | |
| t.Errorf("Admit(%v) = %+v, want admitted %v", c, d, want) | |
| } | |
| if !d.Admitted && d.Reason != UnsupportedCapability { | |
| t.Errorf("Admit(%v) reason = %q, want UnsupportedCapability", c, d.Reason) | |
| } | |
| } | |
| } |
The CapabilityCoreLacks case also passes without the core check it is named for, since its provider lacks the capability too and the provider check refuses it:
galactic/internal/edge/admission/admission_test.go
Lines 115 to 117 in b00948a
| {"CapabilityCoreLacks", func(r *Request, _ *Grant) { | |
| r.Capabilities = []Capability{{Name: "RouteExchange", Version: "v1"}} | |
| }, epoch, UnsupportedCapability}, |
Acceptance criteria
- The tests fail when admission refuses any capability version the contract lists as implemented
- The core-lacks case fails when the core capability check is removed
Metadata
Metadata
Assignees
Labels
galactic-edgeRelated to galactic-edgetech-debtInternal quality/maintenance: unwind shortcuts, config drift, overdue upgrades, fork/dep hygiene
Type
Fields
Priority
None yet
Activity