mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Merge branch '2.2' into 3.0
# Conflicts: # gns3server/compute/base_node.py # gns3server/compute/docker/docker_vm.py # gns3server/compute/dynamips/nodes/c1700.py # gns3server/compute/dynamips/nodes/c2600.py # gns3server/compute/dynamips/nodes/c2691.py # gns3server/compute/dynamips/nodes/c3600.py # gns3server/compute/dynamips/nodes/c3725.py # gns3server/compute/dynamips/nodes/c3745.py # gns3server/compute/dynamips/nodes/c7200.py # gns3server/compute/dynamips/nodes/router.py # gns3server/compute/qemu/qemu_vm.py # gns3server/controller/node.py # gns3server/controller/topology.py # gns3server/handlers/api/compute/docker_handler.py # gns3server/handlers/api/compute/dynamips_vm_handler.py # gns3server/handlers/api/compute/qemu_handler.py # gns3server/schemas/docker.py # gns3server/schemas/docker_template.py # gns3server/schemas/dynamips_template.py # gns3server/schemas/dynamips_vm.py # gns3server/schemas/node.py # gns3server/schemas/qemu.py # gns3server/schemas/qemu_template.py
This commit is contained in:
commit
8ce0cbf7f7
@ -194,7 +194,7 @@ def load_topology(path):
|
|||||||
try:
|
try:
|
||||||
_check_topology_schema(topo, path)
|
_check_topology_schema(topo, path)
|
||||||
except ControllerError as e:
|
except ControllerError as e:
|
||||||
log.error("Can't load the topology %s", path)
|
log.error("Can't load the topology %s, please check using the debug mode...", path)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
if changed:
|
if changed:
|
||||||
|
@ -45,8 +45,9 @@ async def manager(port_manager):
|
|||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
async def vm(compute_project, manager):
|
async def vm(compute_project, manager):
|
||||||
|
|
||||||
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", aux_type="none")
|
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest")
|
||||||
vm._cid = "e90e34656842"
|
vm._cid = "e90e34656842"
|
||||||
|
vm.allocate_aux = False
|
||||||
vm.mac_address = '02:42:3d:b7:93:00'
|
vm.mac_address = '02:42:3d:b7:93:00'
|
||||||
return vm
|
return vm
|
||||||
|
|
||||||
@ -63,7 +64,6 @@ def test_json(vm, compute_project):
|
|||||||
'mac_address': '02:42:3d:b7:93:00',
|
'mac_address': '02:42:3d:b7:93:00',
|
||||||
'console': vm.console,
|
'console': vm.console,
|
||||||
'console_type': 'telnet',
|
'console_type': 'telnet',
|
||||||
'aux_type': 'none',
|
|
||||||
'console_resolution': '1024x768',
|
'console_resolution': '1024x768',
|
||||||
'console_http_port': 80,
|
'console_http_port': 80,
|
||||||
'console_http_path': '/',
|
'console_http_path': '/',
|
||||||
@ -1077,7 +1077,7 @@ async def test_start(vm, manager, free_console_port, tmpdir):
|
|||||||
assert vm.status != "started"
|
assert vm.status != "started"
|
||||||
vm.adapters = 1
|
vm.adapters = 1
|
||||||
|
|
||||||
vm.aux_type = "telnet"
|
vm.allocate_aux = True
|
||||||
vm._start_aux = AsyncioMagicMock()
|
vm._start_aux = AsyncioMagicMock()
|
||||||
|
|
||||||
vm._get_container_state = AsyncioMagicMock(return_value="stopped")
|
vm._get_container_state = AsyncioMagicMock(return_value="stopped")
|
||||||
@ -1699,7 +1699,6 @@ async def test_start_vnc_missing(vm):
|
|||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_start_aux(vm):
|
async def test_start_aux(vm):
|
||||||
|
|
||||||
vm.aux_type = "telnet"
|
|
||||||
with asyncio_patch("asyncio.subprocess.create_subprocess_exec", return_value=MagicMock()) as mock_exec:
|
with asyncio_patch("asyncio.subprocess.create_subprocess_exec", return_value=MagicMock()) as mock_exec:
|
||||||
await vm._start_aux()
|
await vm._start_aux()
|
||||||
mock_exec.assert_called_with(
|
mock_exec.assert_called_with(
|
||||||
|
@ -104,7 +104,7 @@ def test_aux(compute_project, manager, port_manager):
|
|||||||
aux = port_manager.get_free_tcp_port(compute_project)
|
aux = port_manager.get_free_tcp_port(compute_project)
|
||||||
port_manager.release_tcp_port(aux, compute_project)
|
port_manager.release_tcp_port(aux, compute_project)
|
||||||
|
|
||||||
node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux=aux, aux_type="telnet")
|
node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux=aux)
|
||||||
assert node.aux == aux
|
assert node.aux == aux
|
||||||
node.aux = None
|
node.aux = None
|
||||||
assert node.aux is None
|
assert node.aux is None
|
||||||
@ -116,13 +116,12 @@ def test_allocate_aux(compute_project, manager):
|
|||||||
assert node.aux is None
|
assert node.aux is None
|
||||||
|
|
||||||
# Docker has an aux port by default
|
# Docker has an aux port by default
|
||||||
node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux_type="telnet")
|
node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu")
|
||||||
assert node.aux is not None
|
assert node.aux is not None
|
||||||
|
|
||||||
|
|
||||||
def test_change_aux_port(compute_project, manager, port_manager):
|
def test_change_aux_port(node, port_manager):
|
||||||
|
|
||||||
node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux_type="telnet")
|
|
||||||
port1 = port_manager.get_free_tcp_port(node.project)
|
port1 = port_manager.get_free_tcp_port(node.project)
|
||||||
port2 = port_manager.get_free_tcp_port(node.project)
|
port2 = port_manager.get_free_tcp_port(node.project)
|
||||||
port_manager.release_tcp_port(port1, node.project)
|
port_manager.release_tcp_port(port1, node.project)
|
||||||
|
@ -122,8 +122,6 @@ def test_json(node, compute):
|
|||||||
"console": node.console,
|
"console": node.console,
|
||||||
"console_type": node.console_type,
|
"console_type": node.console_type,
|
||||||
"console_host": str(compute.console_host),
|
"console_host": str(compute.console_host),
|
||||||
"aux": node.aux,
|
|
||||||
"aux_type": node.aux_type,
|
|
||||||
"command_line": None,
|
"command_line": None,
|
||||||
"node_directory": None,
|
"node_directory": None,
|
||||||
"properties": node.properties,
|
"properties": node.properties,
|
||||||
@ -161,8 +159,6 @@ def test_json(node, compute):
|
|||||||
"name": "demo",
|
"name": "demo",
|
||||||
"console": node.console,
|
"console": node.console,
|
||||||
"console_type": node.console_type,
|
"console_type": node.console_type,
|
||||||
"aux": node.aux,
|
|
||||||
"aux_type": node.aux_type,
|
|
||||||
"properties": node.properties,
|
"properties": node.properties,
|
||||||
"x": node.x,
|
"x": node.x,
|
||||||
"y": node.y,
|
"y": node.y,
|
||||||
|
Loading…
Reference in New Issue
Block a user