Skip to content

Edge admission tests miss a dropped capability version #1076

Closed

Description

@privateip

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:

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:

{"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

Activity

  1. added
    tech-debt
    on Oct 24, 2026
  2. added theissue type on Oct 24, 2026
  3. self-assigned this
    on Oct 24, 2026
  4. added
    galactic-edge
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

galactic-edgetech-debt

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions