Exemplo n.º 1
0
def touch_files_under_vm_disks(vm_id, ephemeral=0, swap=0, vm_type='volume',
                               disks=None):
    expt_len = 1 + int(bool(ephemeral)) + int(bool(swap)) + (
        1 if 'with_vol' in vm_type else 0)

    LOG.tc_step("Auto mount ephemeral, swap, and attached volume if any")
    mounts = vm_helper.auto_mount_vm_disks(vm_id=vm_id, disks=disks)
    assert expt_len == len(mounts)

    LOG.tc_step("Create files under vm disks: {}".format(mounts))
    file_paths, content = vm_helper.touch_files(vm_id=vm_id, file_dirs=mounts)
    return file_paths, content
Exemplo n.º 2
0
def touch_files_under_vm_disks(vm_id, ephemeral, swap, vm_type, disks):
    expt_len = 1 + int(bool(ephemeral)) + int(bool(swap)) + \
               (1 if 'with_vol' in vm_type else 0)

    LOG.info("\n--------------------------Auto mount non-root disks if any")
    mounts = vm_helper.auto_mount_vm_disks(vm_id=vm_id, disks=disks)
    assert expt_len == len(mounts)

    if bool(swap):
        mounts.remove('none')

    LOG.info("\n--------------------------Create files under vm disks: "
             "{}".format(mounts))
    file_paths, content = vm_helper.touch_files(vm_id=vm_id, file_dirs=mounts)
    return file_paths, content