def prepare():
    base_prepare()
    cache_device = next(disk for disk in TestProperties.dut.disks
                        if disk.disk_type in [DiskType.optane, DiskType.nand])
    core_device = next(disk for disk in TestProperties.dut.disks
                       if (disk.disk_type.value > cache_device.disk_type.value
                           and disk != cache_device))

    cache_device.create_partitions([Size(500, Unit.MebiByte)])
    core_device.create_partitions([
        Size(1, Unit.GibiByte),
        Size(1, Unit.GibiByte),
        Size(1, Unit.GibiByte)
    ])

    cache_device = cache_device.partitions[0]
    core_device_1 = core_device.partitions[0]
    core_device_2 = core_device.partitions[1]
    core_device_3 = core_device.partitions[2]

    TestProperties.LOGGER.info("Staring cache")
    cache = casadm.start_cache(cache_device, force=True)
    TestProperties.LOGGER.info("Adding core device")
    core_1 = cache.add_core(core_dev=core_device_1)
    core_2 = cache.add_core(core_dev=core_device_2)
    core_3 = cache.add_core(core_dev=core_device_3)

    return cache, core_device
def prepare():
    base_prepare()
    ioclass_config.remove_ioclass_config()
    cache_device = next(
        disk
        for disk in TestProperties.dut.disks
        if disk.disk_type in [DiskType.optane, DiskType.nand]
    )
    core_device = next(
        disk
        for disk in TestProperties.dut.disks
        if (disk.disk_type.value > cache_device.disk_type.value and disk != cache_device)
    )

    cache_device.create_partitions([Size(500, Unit.MebiByte)])
    core_device.create_partitions([Size(2, Unit.GibiByte)])

    cache_device = cache_device.partitions[0]
    core_device_1 = core_device.partitions[0]

    Udev.disable()

    TestProperties.LOGGER.info(f"Staring cache")
    cache = casadm.start_cache(cache_device, force=True)
    TestProperties.LOGGER.info(f"Setting cleaning policy to NOP")
    cache.set_cleaning_policy(CleaningPolicy.nop)
    TestProperties.LOGGER.info(f"Adding core devices")
    core = cache.add_core(core_dev=core_device_1)

    output = TestProperties.executor.execute(f"mkdir -p {mountpoint}")
    if output.exit_code != 0:
        raise Exception(f"Failed to create mountpoint")

    return cache, core
def prepare():
    base_prepare()
    ioclass_config.remove_ioclass_config()
    cache_device = next(disk for disk in TestProperties.dut.disks
                        if disk.disk_type in [DiskType.optane, DiskType.nand])
    core_device = next(disk for disk in TestProperties.dut.disks
                       if (disk.disk_type.value > cache_device.disk_type.value
                           and disk != cache_device))

    cache_device.create_partitions([Size(500, Unit.MebiByte)])
    core_device.create_partitions([Size(1, Unit.GibiByte)])

    cache_device = cache_device.partitions[0]
    core_device = core_device.partitions[0]

    TestProperties.LOGGER.info(f"Staring cache")
    cache = casadm.start_cache(cache_device,
                               cache_mode=CacheMode.WB,
                               force=True)
    TestProperties.LOGGER.info(f"Setting cleaning policy to NOP")
    casadm.set_param_cleaning(cache_id=cache.cache_id,
                              policy=CleaningPolicy.nop)
    TestProperties.LOGGER.info(f"Adding core device")
    core = casadm.add_core(cache, core_dev=core_device)

    ioclass_config.create_ioclass_config(
        add_default_rule=False, ioclass_config_path=ioclass_config_path)
    # To make test more precise all workload except of tested ioclass should be
    # put in pass-through mode
    ioclass_config.add_ioclass(
        ioclass_id=0,
        eviction_priority=22,
        allocation=False,
        rule=f"unclassified",
        ioclass_config_path=ioclass_config_path,
    )

    output = TestProperties.executor.execute(f"mkdir -p {mountpoint}")
    if output.exit_code != 0:
        raise Exception(f"Failed to create mountpoint")

    return cache, core
示例#4
0
def prepare():
    base_prepare()