Skip to content

Commit

Permalink
tests: add disabling udev in fault injection test
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
  • Loading branch information
Kamil Gierszewski committed Oct 2, 2024
1 parent cd8d81c commit 01791b7
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,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 +334,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 +386,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

0 comments on commit 01791b7

Please sign in to comment.