def test_console(project, manager): node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager) node.console = 5011 assert node.console == 5011 node.console = None assert node.console is None
def test_console_vnc_invalid(compute_project, manager): node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager) node._console_type = "vnc" with pytest.raises(NodeError): node.console = 2012
def vm(project, manager, ubridge_path): vm = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager) vm._vpcs_version = parse_version("0.9") vm._start_ubridge = AsyncioMagicMock() vm._ubridge_hypervisor = MagicMock() vm._ubridge_hypervisor.is_running.return_value = True return vm
def test_allocate_aux(project, manager): node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager) assert node.aux is None # Docker has an aux port by default node = DockerVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager, "ubuntu") assert node.aux is not None
def test_temporary_directory(compute_project, manager): node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager) assert isinstance(node.temporary_directory, str)
def node(compute_project, manager): return VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager)
async def test_vm(compute_project, manager): vm = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager) assert vm.name == "test" assert vm.id == "00010203-0405-0607-0809-0a0b0c0d0e0f"
def test_console_vnc_invalid(project, manager): node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager) node._console_type = "vnc" with pytest.raises(NodeError): node.console = 2012
def vm(project, manager, ubridge_path): vm = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager) vm._vpcs_version = parse_version("0.9") vm._start_ubridge = AsyncioMagicMock() return vm