示例#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
示例#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
示例#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
示例#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
示例#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
示例#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)
示例#7
0
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"
示例#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
示例#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
示例#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