Ejemplo n.º 1
0
def vm(project, manager, tmpdir, fake_iou_bin, iourc_file):
    fake_file = str(tmpdir / "iouyap")
    with open(fake_file, "w+") as f:
        f.write("1")

    vm = IOUVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager)
    config = manager.config.get_section_config("IOU")
    config["iouyap_path"] = fake_file
    config["iourc_path"] = iourc_file
    manager.config.set_section_config("IOU", config)

    vm.path = fake_iou_bin
    return vm
Ejemplo n.º 2
0
def vm(project, manager, tmpdir, fake_iou_bin, iourc_file):
    fake_file = str(tmpdir / "iouyap")
    with open(fake_file, "w+") as f:
        f.write("1")

    vm = IOUVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", project, manager)
    config = manager.config.get_section_config("IOU")
    config["iouyap_path"] = fake_file
    config["iourc_path"] = iourc_file
    manager.config.set_section_config("IOU", config)

    vm.path = fake_iou_bin
    return vm
Ejemplo n.º 3
0
def vm(project, manager, tmpdir, fake_iou_bin, iourc_file):
    fake_file = str(tmpdir / "iouyap")
    with open(fake_file, "w+") as f:
        f.write("1")

    vm = IOUVM("test", str(uuid.uuid4()), project, manager)
    config = manager.config.get_section_config("IOU")
    config["iouyap_path"] = fake_file
    config["iourc_path"] = iourc_file
    manager.config.set_section_config("IOU", config)

    vm.path = "iou.bin"
    return vm
Ejemplo n.º 4
0
def test_vm_invalid_iouyap_path(project, manager, loop, fake_iou_bin):
    with pytest.raises(IOUError):
        vm = IOUVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0e", project,
                   manager)
        vm.path = fake_iou_bin
        loop.run_until_complete(asyncio. async (vm.start()))
Ejemplo n.º 5
0
def test_vm_invalid_iouyap_path(project, manager, loop, fake_iou_bin):
    with pytest.raises(IOUError):
        vm = IOUVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0e", project, manager)
        vm.path = "iou.bin"
        loop.run_until_complete(asyncio.async(vm.start()))