From 628aba9d6c595ee347b9b14b93c8fe4b896d9251 Mon Sep 17 00:00:00 2001 From: Scot Schuchert-Wells Date: Sat, 7 Nov 2026 17:42:01 +0000 Subject: [PATCH] test(cni): Pin the empty egress group when no shard resolves When every shard of a group fails to resolve, as happens when each one matches only a default route, the group must publish no active shard, hold no standby and leave every Maglev slot empty, so tenants hit group_empty rather than a dead shard. --- .../egressroutemap/shardgroup_standby_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/plumbing/ebpf/egressroutemap/shardgroup_standby_test.go b/internal/plumbing/ebpf/egressroutemap/shardgroup_standby_test.go index 4ccacf51..f14125a8 100644 --- a/internal/plumbing/ebpf/egressroutemap/shardgroup_standby_test.go +++ b/internal/plumbing/ebpf/egressroutemap/shardgroup_standby_test.go @@ -124,6 +124,22 @@ func TestApplyNAT64Standby(t *testing.T) { }, want: map[netip.Addr]wantShard{primary: {unreachable: true}, other: {active: true}, standby: {held: true}}, }, + { + name: "every shard unreachable: the NAT64 group is empty and nothing is held", + class: standbyTestNAT64, + shards: []standbyShard{ + {sid: primary}, {sid: other}, {sid: standby, standby: true}, + }, + want: map[netip.Addr]wantShard{ + primary: {unreachable: true}, other: {unreachable: true}, standby: {unreachable: true}, + }, + }, + { + name: "every shard unreachable: the NAT66 group is empty", + class: NAT66Class, + shards: []standbyShard{{sid: primary}, {sid: other}}, + want: map[netip.Addr]wantShard{primary: {unreachable: true}, other: {unreachable: true}}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {