Exemple #1
0
async def test_vm_create(tmpdir, compute_project, manager, fake_qemu_binary):

    fake_img = str(tmpdir / 'hello')

    with open(fake_img, 'w+') as f:
        f.write('hello')

    vm = QemuVM("test", "00010203-0405-0607-0809-0a0b0c0d0e0f", compute_project, manager, qemu_path=fake_qemu_binary)
    vm._hda_disk_image = fake_img

    await vm.create()

    # tests if `create` created md5sums
    assert os.path.exists(str(tmpdir / 'hello.md5sum'))
Exemple #2
0
def test_vm_create(loop, tmpdir, project, manager, fake_qemu_binary):
    fake_img = str(tmpdir / 'hello')

    with open(fake_img, 'w+') as f:
        f.write('hello')

    vm = QemuVM("test",
                "00010203-0405-0607-0809-0a0b0c0d0e0f",
                project,
                manager,
                qemu_path=fake_qemu_binary)
    vm._hda_disk_image = fake_img

    loop.run_until_complete(asyncio.ensure_future(vm.create()))

    # tests if `create` created md5sums
    assert os.path.exists(str(tmpdir / 'hello.md5sum'))