@@ -5,9 +5,10 @@
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from api.cas import casadm, casadm_parser
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_utils.size import Unit, Size
|
||||
|
||||
|
||||
@@ -45,6 +46,7 @@ def test_cli_start_stop_default_value(shortcut):
|
||||
|
||||
|
||||
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.nand, DiskType.optane]))
|
||||
@pytest.mark.require_disk("core", DiskTypeLowerThan("cache"))
|
||||
@pytest.mark.parametrize("shortcut", [True, False])
|
||||
def test_cli_add_remove_default_value(shortcut):
|
||||
cache_device = TestRun.disks['cache']
|
||||
@@ -52,8 +54,7 @@ def test_cli_add_remove_default_value(shortcut):
|
||||
cache_device = cache_device.partitions[0]
|
||||
cache = casadm.start_cache(cache_device, shortcut=shortcut, force=True)
|
||||
|
||||
core_device = next(
|
||||
disk for disk in TestRun.dut.disks if disk.disk_type != DiskType.optane)
|
||||
core_device = TestRun.disks['core']
|
||||
casadm.add_core(cache, core_device, shortcut=shortcut)
|
||||
|
||||
caches = casadm_parser.get_caches()
|
||||
|
@@ -5,12 +5,13 @@
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
from api.cas import casadm
|
||||
from api.cas.cache_config import CacheMode
|
||||
from core.test_run import TestRun
|
||||
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
|
||||
from test_utils.size import Size, Unit
|
||||
from api.cas.cache_config import CacheMode
|
||||
from api.cas import casadm
|
||||
from test_tools.dd import Dd
|
||||
from test_utils.size import Size, Unit
|
||||
|
||||
|
||||
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))
|
||||
@@ -63,7 +64,6 @@ def test_core_inactive_stats():
|
||||
|
||||
cache_device = cache.cache_device
|
||||
|
||||
TestRun.LOGGER.info(cache_device)
|
||||
TestRun.LOGGER.info("Switching cache mode to WB")
|
||||
cache.set_cache_mode(cache_mode=CacheMode.WB)
|
||||
cores = cache.get_core_devices()
|
||||
@@ -125,7 +125,7 @@ def test_core_inactive_stats():
|
||||
inactive_clean_perc = round(100 * inactive_clean_perc, 1)
|
||||
inactive_dirty_perc = round(100 * inactive_dirty_perc, 1)
|
||||
|
||||
TestRun.LOGGER.info(cache_stats_percentage)
|
||||
TestRun.LOGGER.info(str(cache_stats_percentage))
|
||||
assert inactive_occupancy_perc == cache_stats_percentage["inactive occupancy"]
|
||||
assert inactive_clean_perc == cache_stats_percentage["inactive clean"]
|
||||
assert inactive_dirty_perc == cache_stats_percentage["inactive dirty"]
|
||||
|
Reference in New Issue
Block a user