Skip to content

Commit

Permalink
Merge pull request #1538 from Kamoppl/kamilg/fix_scope_bugs_v4
Browse files Browse the repository at this point in the history
Kamilg/fix scope bugs v4
  • Loading branch information
katlapinka authored Oct 11, 2024
2 parents c1ad2a8 + 5cada7a commit e7f14f7
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 188 deletions.
2 changes: 1 addition & 1 deletion test/functional/api/cas/cli_help_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
]

zero_metadata_help = [
r"Usage: casadm --zero-metadata --device \<DEVICE\> \[option\.\.\.\]]",
r"Usage: casadm --zero-metadata --device \<DEVICE\> \[option\.\.\.\]",
r"Clear metadata from caching device",
r"Options that are valid with --zero-metadata are:",
r"-d --device \<DEVICE\> Path to device on which metadata would be cleared",
Expand Down
5 changes: 4 additions & 1 deletion test/functional/api/cas/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ def __init__(self, stats_dict):
self.cache_line_size = parse_value(
value=stats_dict["Cache line size [KiB]"], unit_type=UnitType.kibibyte
)
footprint_prefix = "Metadata Memory Footprint "
footprint_key = next(k for k in stats_dict if k.startswith(footprint_prefix))
self.metadata_memory_footprint = parse_value(
value=stats_dict["Metadata Memory Footprint [MiB]"], unit_type=UnitType.mebibyte
value=stats_dict[footprint_key],
unit_type=UnitType(footprint_key[len(footprint_prefix) :]),
)
self.dirty_for = parse_value(value=stats_dict["Dirty for [s]"], unit_type=UnitType.seconds)
self.status = stats_dict["Status"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright(c) 2020-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

Expand Down Expand Up @@ -317,6 +318,9 @@ def test_interrupt_cache_mode_switch_parametrized(cache_mode, stop_percentage):
with TestRun.step("Prepare cache and core."):
cache_part, core_part = prepare()

with TestRun.step("Disable udev"):
Udev.disable()

for _ in TestRun.iteration(
range(iterations_per_config), f"Reload cache configuration {iterations_per_config} times."
):
Expand All @@ -331,16 +335,21 @@ def test_interrupt_cache_mode_switch_parametrized(cache_mode, stop_percentage):
core = cache.add_core(core_part)

with TestRun.step(f"Create test file in mount point of exported object."):
test_file_size = Size(1024, Unit.MebiByte)
test_file_size = Size(4, Unit.GibiByte)
test_file = fs_utils.create_random_test_file(test_file_path, test_file_size)

with TestRun.step("Check md5 sum of test file."):
test_file_md5_before = test_file.md5sum()

with TestRun.step("Export file to CAS"):
Dd().block_size(test_file_size).input(test_file.full_path).output(core.path).oflag(
"direct"
).run()
dd = (
Dd()
.block_size(test_file_size)
.input(test_file.full_path)
.output(core.path)
.oflag("direct")
)
dd.run()

with TestRun.step("Get number of dirty data on exported object before interruption."):
os_utils.sync()
Expand Down Expand Up @@ -378,7 +387,7 @@ def test_interrupt_cache_mode_switch_parametrized(cache_mode, stop_percentage):
if cache.get_cache_mode() != cache_mode:
TestRun.LOGGER.error("Cache mode should remain the same.")

with TestRun.step("Unmount core and stop cache."):
with TestRun.step("Stop cache."):
cache.stop()

with TestRun.step("Check md5 sum of test file again."):
Expand Down
Loading

0 comments on commit e7f14f7

Please sign in to comment.