tests: fault_injection: Disable udev, purge cache and reset stats
Improve accounting precision by eliminating noise. Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
parent
1f89ce7cfc
commit
783e0229a5
@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2019-2022 Intel Corporation
|
# Copyright(c) 2019-2022 Intel Corporation
|
||||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -245,4 +245,8 @@ def prepare_configuration(cache_mode, cache_line_size):
|
|||||||
with TestRun.step("Adding core device"):
|
with TestRun.step("Adding core device"):
|
||||||
core = cache.add_core(core_dev=core_device.partitions[0])
|
core = cache.add_core(core_dev=core_device.partitions[0])
|
||||||
|
|
||||||
|
with TestRun.step("Purge cache and reset statistics"):
|
||||||
|
cache.purge_cache()
|
||||||
|
cache.reset_counters()
|
||||||
|
|
||||||
return cache, core, core_device.partitions[0]
|
return cache, core, core_device.partitions[0]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ from api.cas.cache_config import (
|
|||||||
)
|
)
|
||||||
from storage_devices.disk import DiskTypeSet, DiskType
|
from storage_devices.disk import DiskTypeSet, DiskType
|
||||||
from test_utils.io_stats import IoStats
|
from test_utils.io_stats import IoStats
|
||||||
|
from test_tools.udev import Udev
|
||||||
from type_def.size import Size, Unit
|
from type_def.size import Size, Unit
|
||||||
|
|
||||||
|
|
||||||
@ -63,6 +64,13 @@ def test_error_device_as_cache_clean_wt(cache_line_size):
|
|||||||
with TestRun.step(f"Add core"):
|
with TestRun.step(f"Add core"):
|
||||||
core = cache.add_core(core_dev=core_device.partitions[0])
|
core = cache.add_core(core_dev=core_device.partitions[0])
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
|
with TestRun.step("Purge cache and reset statistics"):
|
||||||
|
cache.purge_cache()
|
||||||
|
cache.reset_counters()
|
||||||
|
|
||||||
with TestRun.step("Run fio against core to fill it with pattern"):
|
with TestRun.step("Run fio against core to fill it with pattern"):
|
||||||
fio = (
|
fio = (
|
||||||
Fio()
|
Fio()
|
||||||
@ -90,11 +98,17 @@ def test_error_device_as_cache_clean_wt(cache_line_size):
|
|||||||
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
||||||
cache.stop()
|
cache.stop()
|
||||||
|
|
||||||
|
with TestRun.step("Enable udev"):
|
||||||
|
Udev.enable()
|
||||||
|
|
||||||
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
||||||
error_device.change_table(
|
error_device.change_table(
|
||||||
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
with TestRun.step("Load cache and reset counters"):
|
with TestRun.step("Load cache and reset counters"):
|
||||||
cache = casadm.load_cache(error_device)
|
cache = casadm.load_cache(error_device)
|
||||||
cache.reset_counters()
|
cache.reset_counters()
|
||||||
@ -175,6 +189,13 @@ def test_error_device_as_cache_clean_wa(cache_line_size):
|
|||||||
with TestRun.step(f"Add core"):
|
with TestRun.step(f"Add core"):
|
||||||
core = cache.add_core(core_dev=core_device.partitions[0])
|
core = cache.add_core(core_dev=core_device.partitions[0])
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
|
with TestRun.step("Purge cache and reset statistics"):
|
||||||
|
cache.purge_cache()
|
||||||
|
cache.reset_counters()
|
||||||
|
|
||||||
with TestRun.step("Run fio against core to fill it with pattern"):
|
with TestRun.step("Run fio against core to fill it with pattern"):
|
||||||
fio = (
|
fio = (
|
||||||
Fio()
|
Fio()
|
||||||
@ -200,11 +221,17 @@ def test_error_device_as_cache_clean_wa(cache_line_size):
|
|||||||
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
||||||
cache.stop()
|
cache.stop()
|
||||||
|
|
||||||
|
with TestRun.step("Enable udev"):
|
||||||
|
Udev.enable()
|
||||||
|
|
||||||
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
||||||
error_device.change_table(
|
error_device.change_table(
|
||||||
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
with TestRun.step("Load cache and reset counters"):
|
with TestRun.step("Load cache and reset counters"):
|
||||||
cache = casadm.load_cache(error_device)
|
cache = casadm.load_cache(error_device)
|
||||||
cache.reset_counters()
|
cache.reset_counters()
|
||||||
@ -288,6 +315,13 @@ def test_error_device_as_cache_dirty(cache_mode, cache_line_size):
|
|||||||
with TestRun.step(f"Add core"):
|
with TestRun.step(f"Add core"):
|
||||||
cores = [cache.add_core(core_dev=core) for core in core_parts]
|
cores = [cache.add_core(core_dev=core) for core in core_parts]
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
|
with TestRun.step("Purge cache and reset statistics"):
|
||||||
|
cache.purge_cache()
|
||||||
|
cache.reset_counters()
|
||||||
|
|
||||||
with TestRun.step("Run io against the first core to fill it with pattern"):
|
with TestRun.step("Run io against the first core to fill it with pattern"):
|
||||||
fio = (
|
fio = (
|
||||||
Fio()
|
Fio()
|
||||||
@ -314,12 +348,18 @@ def test_error_device_as_cache_dirty(cache_mode, cache_line_size):
|
|||||||
with TestRun.step("Stop cache"):
|
with TestRun.step("Stop cache"):
|
||||||
cache.stop(no_data_flush=True)
|
cache.stop(no_data_flush=True)
|
||||||
|
|
||||||
|
with TestRun.step("Enable udev"):
|
||||||
|
Udev.enable()
|
||||||
|
|
||||||
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
with TestRun.step("Enable errors on cache device (after metadata area)"):
|
||||||
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
metadata_size = cache.get_metadata_size_on_disk() + Size(1, Unit.MiB)
|
||||||
error_device.change_table(
|
error_device.change_table(
|
||||||
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
error_table(start_lba=metadata_size, stop_lba=cache_part.size).fill_gaps(cache_part)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with TestRun.step("Disable udev"):
|
||||||
|
Udev.disable()
|
||||||
|
|
||||||
with TestRun.step("Load cache and reset counters"):
|
with TestRun.step("Load cache and reset counters"):
|
||||||
cache = casadm.load_cache(error_device)
|
cache = casadm.load_cache(error_device)
|
||||||
cache.reset_counters()
|
cache.reset_counters()
|
||||||
|
Loading…
Reference in New Issue
Block a user