diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index 17603eda..cb52b64d 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -45,9 +45,8 @@ 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") + vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", aux_type="none") vm._cid = "e90e34656842" - vm.allocate_aux = False vm.mac_address = '02:42:3d:b7:93:00' return vm @@ -64,6 +63,7 @@ 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': '/', @@ -1077,7 +1077,7 @@ async def test_start(vm, manager, free_console_port, tmpdir): assert vm.status != "started" vm.adapters = 1 - vm.allocate_aux = True + vm.aux_type = "telnet" vm._start_aux = AsyncioMagicMock() vm._get_container_state = AsyncioMagicMock(return_value="stopped") @@ -1699,6 +1699,7 @@ 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( diff --git a/tests/compute/test_base_node.py b/tests/compute/test_base_node.py index 04fcb98a..58c06ff5 100644 --- a/tests/compute/test_base_node.py +++ b/tests/compute/test_base_node.py @@ -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) + node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux=aux, aux_type="telnet") assert node.aux == aux node.aux = None assert node.aux is None @@ -116,12 +116,13 @@ 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") + node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, "ubuntu", aux_type="telnet") assert node.aux is not None -def test_change_aux_port(node, port_manager): +def test_change_aux_port(compute_project, manager, 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) diff --git a/tests/controller/test_node.py b/tests/controller/test_node.py index 454ada35..2192444b 100644 --- a/tests/controller/test_node.py +++ b/tests/controller/test_node.py @@ -122,6 +122,8 @@ 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, @@ -159,6 +161,8 @@ 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,