docs(spec): record the delivered L2-only anchors and their residual

uBridge delivered `link l2only` (e2e3155) and the brctl delete refusal
(83a84fb); verified from the server side -- anchors and per-link bridges
report addrgenmode none, carry no addresses, and an idle anchor is silent
once the one-shot membership burst has settled.

That burst is the one thing the command cannot remove, so it is now recorded
where the acceptance criteria live, with the measurement: enslaving a port
makes the kernel announce the bridge's multicast memberships (90 B MLDv2 at
+0.00 s, 54 B IGMPv3 at +0.09 s, 90 B MLDv2 at +0.73 s, then silence; no
addresses involved, and IPv4 has no per-device IGMP switch). Decision:
accepted and documented, not suppressed -- §E.2 measures idle silence after a
settle window instead.

Pins the other delivered behaviour with a test: a bridge now survives a
single-sided node stop, so brctl create answers EEXIST on the common path
rather than only in a create race -- the attach must not short-circuit there,
because the restarted side has a brand-new anchor whose filters and markers
still have to be re-applied.
This commit is contained in:
YueGuobin committed 2026-10-06 00:21:08 +08:00
1 parent a1fcd29bce
commit 81ad9b837f
3 files changed
+84 -12

No files matched your search

@@ -291,6 +291,37 @@ async def test_connect_nio_kernel_tolerates_bridge_create_race(vm):
vm._ubridge_send.assert_any_call(f'brctl addif "{BRIDGE}" "{host_ifc}"')
@pytest.mark.asyncio
async def test_connect_nio_kernel_eexist_still_reapplies_everything(vm):
"""
EEXIST is a *common* path now: a bridge survives a single-sided node
restart (the peer's still-enslaved port makes brctl delete answer EBUSY,
which is suppressed), so the restarted side finds its bridge already
there. The create-or-verify step must not short-circuit the rest of the
attach — the restarted side has a brand-new anchor and needs its capture,
markers and filters re-applied on it.
"""
async def send(command):
if "brctl create" in command:
raise UbridgeError("Could not create bridge gns3a1b2c3d4e5f: File exists (EEXIST)")
vm._ubridge_send = AsyncioMagicMock(side_effect=send)
host_ifc, _ = vm._veth_names(0, 0)
vm._kernel_veths[(0, 0)] = host_ifc
nio = vm.manager.create_nio({"type": "nio_bridge", "bridge": BRIDGE})
nio.filters = {"delay": [10]}
await vm._connect_nio(0, nio)
vm._ubridge_send.assert_any_call(f'brctl show "{BRIDGE}"')
vm._ubridge_send.assert_any_call(f'brctl addif "{BRIDGE}" "{host_ifc}"')
# ... and the port-level configuration of the fresh anchor goes on top of
# it, unconditionally (never inside a "the bridge was created" branch).
vm._ubridge_send.assert_any_call(f'tc reset "{host_ifc}"')
vm._ubridge_send.assert_any_call(f'tc netem set "{host_ifc}" delay 10')
@pytest.mark.asyncio
async def test_connect_nio_kernel_create_failure_propagates(vm):