mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-30 17:34:34 +02:00
test: cover the kernel-datapath review fixes
Regression coverage added with the fixes: - capture-slot semantics: second-port refusal, failed-start rollback, and a non-owner port's stop not reaching `capture stop_kernel`; - QEMU stop/start teardown on a mid-body or pre-launch failure, IOU start cleanup and filter guards, Dynamips half-attach undo plus retry; - switch VLAN reconcile skipping a deferred anchor and rolling the ports_mapping back on failure; - Docker/QEMU occupied-port refusal, probe ctime invalidation, probe survival of a failing uBridge start; - env-marker dialects (mid-line mentions, falsy values) and the agent merge rejecting entries without a device_name. Test-body imports of product modules move to the shared header.
This commit is contained in:
13 files changed
+438
-40
No files matched your search
@@ -1642,6 +1642,24 @@ async def test_adapter_add_nio_binding_1(vm):
|
||||
assert vm._ethernet_adapters[0].get_nio(0) == nio
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_adapter_add_nio_binding_refuses_an_occupied_port(vm):
|
||||
"""
|
||||
The compute-side backstop of the controller's duplicate-port guard: a
|
||||
second NIO for a port that already carries one is refused instead of
|
||||
silently overwriting the binding the first link's teardown still needs.
|
||||
"""
|
||||
|
||||
first = vm.manager.create_nio({"type": "nio_udp", "lport": 4242, "rport": 4343, "rhost": "127.0.0.1"})
|
||||
await vm.adapter_add_nio_binding(0, first)
|
||||
|
||||
second = vm.manager.create_nio({"type": "nio_udp", "lport": 4244, "rport": 4345, "rhost": "127.0.0.1"})
|
||||
with pytest.raises(DockerError, match="already has a link"):
|
||||
await vm.adapter_add_nio_binding(0, second)
|
||||
|
||||
assert vm._ethernet_adapters[0].get_nio(0) is first
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_adapter_add_nio_binding_sets_carrier(vm):
|
||||
|
||||
|
||||
Reference in new issue
Block a user