mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
fix(mcp): let link_list return kernel_datapath
The tool descriptions have always advertised kernel_datapath as a requestable field, but the handler's whitelist did not contain it: asking for it was rejected as an invalid field, so the MCP clients could not see which links run on kernel interfaces at all. Also record what seeding a netem experiment on IOU costs: IOL emits its own CDP/keepalive frames and they draw from the netem RNG stream, so a seeded run only reproduces after `no cdp run` (verified bit-identical pcaps).
This commit is contained in:
3 files changed
+25
No files matched your search
@@ -425,6 +425,21 @@ class TestLink:
|
||||
result = get_links_handler({"project_id": "p1", "fields": ["link_id"]}, ctx)
|
||||
assert result["links"] == [{"link_id": "l1"}]
|
||||
|
||||
def test_list_can_ask_for_kernel_datapath(self, ctx):
|
||||
"""
|
||||
The datapath is a field the tool descriptions always advertised, so
|
||||
it has to be requestable: a whitelist missing it rejected
|
||||
fields=["kernel_datapath"] and made link_list unable to report which
|
||||
links run on kernel interfaces.
|
||||
"""
|
||||
|
||||
from gns3server.agent.gns3_copilot.gns3_client.api_handlers import get_links_handler
|
||||
|
||||
with patch(f"{AH}._get_connector") as m:
|
||||
m.return_value = _mock_conn([{"link_id": "l1", "link_type": "ethernet", "kernel_datapath": True}])
|
||||
result = get_links_handler({"project_id": "p1", "fields": ["link_id", "kernel_datapath"]}, ctx)
|
||||
assert result["links"] == [{"link_id": "l1", "kernel_datapath": True}]
|
||||
|
||||
def test_get(self, ctx):
|
||||
from gns3server.agent.gns3_copilot.gns3_client.api_handlers import get_link_handler
|
||||
|
||||
|
||||
Reference in new issue
Block a user