mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-19 20:55:14 +02:00
test(e2e): assert the §E.2 idle-silence window in every kernel scenario
The L2-anchor spec's behavioral guarantee — an idle link stays silent for 5 s once the enslavement burst settles — only ran in the Dynamips and Docker suites. It now also runs in QEMU, IOU, the IOL container, the switch fast path and the switch cascade, which covers every host-device creation path: * tap create (Dynamips/QEMU/IOU anchors), docker create_veth (Docker host ends; the cascade's race-loser end is hardened after create by the server), bridge add_nio_tap (the IOL container anchor, the fifth creator), and the brctl switch bridges, whose multicast snooping is off precisely so the bridge role can reach silence; * each scenario silences its guests first (IOS interfaces shut through the console; Docker guests' links down) and re-verifies the ping after; * the cascade measures 8 devices at once (four absorbed router anchors, both cascade ends, both switch bridges). IOL 158 s, cascade 293 s, ESW fast path 378 s, QEMU 428 s, IOU 308 s — all green.
This commit is contained in:
11 files changed
+166
-16
No files matched your search
@@ -24,6 +24,8 @@ Real ICMP crossing the switch proves the datapath:
|
||||
and defer the join; once the routers boot, the controller's re-push
|
||||
makes the switch join their anchors — the switch bridge's members become
|
||||
exactly the two router anchors (no relay TAPs anywhere);
|
||||
* the L2-anchor spec §E.2 silence window with both routers shut: the
|
||||
absorbed anchors and the switch bridge stay silent for 5 s;
|
||||
* VLAN programming applies to absorbed anchors: different access VLANs
|
||||
isolate the routers (ping dies), the same VLAN bridges them again;
|
||||
* a ``delay 100`` filter lands as netem on the absorbed anchor (single
|
||||
@@ -94,6 +96,16 @@ def _boot(server, project_id, node_id, timeout=360):
|
||||
return console
|
||||
|
||||
|
||||
def _eth_shutdown(console, shut):
|
||||
"""Shut/unshut the router's f1/0 — the only legitimate speaker on the
|
||||
segment (IOS's own CDP/keepalives) — for §E.2's silence window; the
|
||||
address stays configured and answers once it is back."""
|
||||
console.run("conf t")
|
||||
console.run("interface f1/0")
|
||||
console.run("shutdown" if shut else "no shutdown")
|
||||
console.run("end")
|
||||
|
||||
|
||||
def test_ethernet_switch_kernel_fast_path():
|
||||
server = harness.live_server(kernel=True)
|
||||
compute = server.compute
|
||||
@@ -140,6 +152,19 @@ def test_ethernet_switch_kernel_fast_path():
|
||||
baseline = harness.wait_ping(c1, "10.1.1.2")
|
||||
assert baseline["success"] == 100, baseline["raw"]
|
||||
|
||||
# L2-anchor spec §E.2: with both routers shut, the absorbed anchors
|
||||
# and the switch bridge stay silent for 5 s (the bridge is created
|
||||
# with multicast snooping off precisely so the bridge role can).
|
||||
if harness.l2only_supported():
|
||||
for console in (c1, c2):
|
||||
_eth_shutdown(console, shut=True)
|
||||
harness.assert_idle_silence(a1, a2, sw_bridge)
|
||||
for console in (c1, c2):
|
||||
_eth_shutdown(console, shut=False)
|
||||
assert harness.wait_ping(c1, "10.1.1.2", attempts=5)["success"] == 100
|
||||
else:
|
||||
print(".. uBridge without link l2only: skipping the §E.2 assertion")
|
||||
|
||||
# L2-anchor spec §E.1: the absorbed anchors and the switch bridge
|
||||
# carry no L3 identity (skipped on a uBridge without `link l2only`),
|
||||
# and the joined ports are FORWARDING — the silent-failure guard.
|
||||
|
||||
Reference in new issue
Block a user