mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
fix(iou): carry suspend from the NIO update body
The IOU NIO update route never copied the body's suspend flag onto the NIO; the Docker and QEMU routes always did. Harmless on the relay, where suspend is emulated by the synthetic frequency_drop filter the controller injects, but fatal on a kernel link, whose suspend *is* the anchor's admin state: a suspended link kept forwarding traffic, and the resume looked like it worked because nothing had ever stopped.
This commit is contained in:
2 files changed
+38
-1
No files matched your search
@@ -297,6 +297,40 @@ class TestIOUNodesRoutes:
|
||||
assert response.json()["type"] == "nio_udp"
|
||||
assert response.json()["filters"] == {}
|
||||
|
||||
async def test_iou_nio_update_carries_suspend_and_bridge(
|
||||
self, app: FastAPI, compute_client: AsyncClient, vm: dict
|
||||
) -> None:
|
||||
"""
|
||||
A kernel-datapath NIO (nio_bridge) is accepted on the IOU routes, and
|
||||
the update body's suspend flag reaches the NIO — the compute turns it
|
||||
into an admin-down anchor, so a dropped suspend would leave a
|
||||
"suspended" link forwarding traffic.
|
||||
"""
|
||||
|
||||
url = app.url_path_for(
|
||||
"compute:create_iou_node_nio",
|
||||
project_id=vm["project_id"],
|
||||
node_id=vm["node_id"],
|
||||
adapter_number="1",
|
||||
port_number="0",
|
||||
)
|
||||
params = {"type": "nio_bridge", "bridge": "gns3a1b2c3d4e5f"}
|
||||
response = await compute_client.post(url, json=params)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.json()["type"] == "nio_bridge"
|
||||
|
||||
url = app.url_path_for(
|
||||
"compute:update_iou_node_nio",
|
||||
project_id=vm["project_id"],
|
||||
node_id=vm["node_id"],
|
||||
adapter_number="1",
|
||||
port_number="0",
|
||||
)
|
||||
params["suspend"] = True
|
||||
response = await compute_client.put(url, json=params)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.json()["suspend"] is True
|
||||
|
||||
async def test_iou_nio_create_ethernet(
|
||||
self, app: FastAPI, compute_client: AsyncClient, vm: dict, ethernet_device: str
|
||||
) -> None:
|
||||
|
||||
Reference in new issue
Block a user