Skip to content

Commit

Permalink
Merge branch '2.2' into 3.0
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
grossmj committed Sep 23, 2024
2 parents d3138da + 7b5d123 commit 8ce0cbf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gns3server/controller/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def load_topology(path):
try:
_check_topology_schema(topo, path)
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

if changed:
Expand Down
7 changes: 3 additions & 4 deletions tests/compute/docker/test_docker_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ async def manager(port_manager):
@pytest_asyncio.fixture(scope="function")
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.allocate_aux = False
vm.mac_address = '02:42:3d:b7:93:00'
return vm

Expand All @@ -63,7 +64,6 @@ def test_json(vm, compute_project):
'mac_address': '02:42:3d:b7:93:00',
'console': vm.console,
'console_type': 'telnet',
'aux_type': 'none',
'console_resolution': '1024x768',
'console_http_port': 80,
'console_http_path': '/',
Expand Down Expand Up @@ -1077,7 +1077,7 @@ async def test_start(vm, manager, free_console_port, tmpdir):
assert vm.status != "started"
vm.adapters = 1

vm.aux_type = "telnet"
vm.allocate_aux = True
vm._start_aux = AsyncioMagicMock()

vm._get_container_state = AsyncioMagicMock(return_value="stopped")
Expand Down Expand Up @@ -1699,7 +1699,6 @@ async def test_start_vnc_missing(vm):
@pytest.mark.asyncio
async def test_start_aux(vm):

vm.aux_type = "telnet"
with asyncio_patch("asyncio.subprocess.create_subprocess_exec", return_value=MagicMock()) as mock_exec:
await vm._start_aux()
mock_exec.assert_called_with(
Expand Down
7 changes: 3 additions & 4 deletions tests/compute/test_base_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_aux(compute_project, manager, port_manager):
aux = port_manager.get_free_tcp_port(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
node.aux = None
assert node.aux is None
Expand All @@ -116,13 +116,12 @@ def test_allocate_aux(compute_project, manager):
assert node.aux is None

# 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


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)
port2 = port_manager.get_free_tcp_port(node.project)
port_manager.release_tcp_port(port1, node.project)
Expand Down
4 changes: 0 additions & 4 deletions tests/controller/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ def test_json(node, compute):
"console": node.console,
"console_type": node.console_type,
"console_host": str(compute.console_host),
"aux": node.aux,
"aux_type": node.aux_type,
"command_line": None,
"node_directory": None,
"properties": node.properties,
Expand Down Expand Up @@ -161,8 +159,6 @@ def test_json(node, compute):
"name": "demo",
"console": node.console,
"console_type": node.console_type,
"aux": node.aux,
"aux_type": node.aux_type,
"properties": node.properties,
"x": node.x,
"y": node.y,
Expand Down

0 comments on commit 8ce0cbf

Please sign in to comment.