Skip to content

Conversation

@Kamoppl
Copy link

@Kamoppl Kamoppl commented Apr 23, 2025

No description provided.

@Kamoppl Kamoppl force-pushed the kamilg/april_2025_tests_refactors branch from 89ba2c6 to dbf1a66 Compare April 23, 2025 00:07
@Kamoppl Kamoppl changed the title tests: Tests refactor tests: Tests refactors Apr 23, 2025
@Kamoppl Kamoppl changed the title tests: Tests refactors tests: Tests refactor Apr 23, 2025
@Kamoppl Kamoppl marked this pull request as ready for review April 23, 2025 00:09
cache.reset_counters()

with TestRun.step(f"Fill exported object with dirty data"):
with TestRun.step(f"Prepare I/O to fill exported object with dirty data"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary f-string
how is I/O prepared here? (preparing config for I/O tool is not a real test step)

dirty_4k = cache.get_statistics().usage_stats.dirty.get_value(Unit.Blocks4096)
fio.verification_with_pattern("0xdeadbeef")

with TestRun.step("Run fio"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see this step before writing my comment for the previous file ;)

Comment on lines 185 to 199
with TestRun.step("Prepare I/O to separate disk test file"):
fio = (
Fio()
.create_command()
.io_engine(IoEngine.libaio)
.read_write(ReadWrite.write)
.block_size(bs)
.block_size(Size(2, Unit.MebiByte))
.direct()
.io_depth(256)
.target(core)
.size(file_size)
)
fio.default_run_time = timedelta(hours=4) # timeout for non-time-based fio

with TestRun.step("Run I/O"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one step

core_disk = TestRun.disks["core"]

cache_disk.create_partitions([Size(100, Unit.MebiByte)])
core_disk.create_partitions([Size(5, Unit.GibiByte)] * 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 is a small number of partitions in a test the randomises the order of adding them


for _ in TestRun.iteration(range(0, iterations_number)):
with TestRun.step("Detach all core devices"):
for core in cores:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think detach order should be also randomized

"""
title: Test for triple level cache.
description: |
Test if cache can be used as core of other cache up to three levels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect - cache can never be used as a core

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move this to another PR

Comment on lines 66 to 70
with TestRun.step("Create file on exported object"):
md5_sums = create_files_with_md5sums(mount_point, 100)

with TestRun.step("Check md5 sums between original file and exported object"):
compare_md5sums(md5_sums, mount_point, copy_to_tmp=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confusing steps - if you create the file on the exported object, then if is the original file, so the last step implies comparing the test file to itself ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move this to another PR

Kamil Gierszewski added 5 commits September 30, 2025 17:21
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
…hronous read of the device

Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
@Kamoppl Kamoppl force-pushed the kamilg/april_2025_tests_refactors branch from dbd184f to 237e25d Compare September 30, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants