Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
def test_temporary_directory(compute_project, manager):

    node = VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f",
                  compute_project, manager)
    assert isinstance(node.temporary_directory, str)
Ejemplo n.º 7
0
def node(compute_project, manager):

    return VPCSVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f",
                  compute_project, manager)
Ejemplo n.º 8
0
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"
Ejemplo n.º 9
0
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
Ejemplo n.º 10
0
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
Ejemplo n.º 11
0
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