-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add_test_metadata_invalidate #1385
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Kamil Gierszewski <[email protected]>
470ba1c
to
8cafdf4
Compare
with TestRun.step("Create 4 partition for core devices"): | ||
cache_dev = TestRun.disks['cache'] | ||
cache_dev.create_partitions([Size(1, Unit.GibiByte)]) | ||
cache_part = cache_dev.partitions[0] | ||
core_dev = TestRun.disks['core'] | ||
core_dev.create_partitions(number_of_cores * [Size(50, Unit.GibiByte)]) | ||
core_part = core_dev.partitions | ||
|
||
with TestRun.step("Start CAS with configuration, add 4 cores and create fs (ext3, ext4, " | ||
"xfs) for 3 core devices"): | ||
cache = casadm.start_cache(cache_part, force=True) | ||
core_partitions = [] | ||
mount_point_dict = dict() | ||
for index, filesystem in enumerate(Filesystem): | ||
core_partitions.append(cache.add_core(core_part[index])) | ||
core_partitions[index].create_filesystem(filesystem) | ||
mount_point = f"/mnt/CasMetadataInvalidate/{index}" | ||
core_partitions[index].mount(mount_point) | ||
mount_point_dict[mount_point] = core_partitions[index] | ||
unmounted_device = core_part[-1] | ||
unmounted_core = cache.add_core(unmounted_device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding core per each filesystem please add single core and parametrize test with filesystem.
def __create_fio_jobs(write_policy, fio_write, pattern, mount_point_dict, unmounted_device_path, | ||
verify_only=False): | ||
fio = (Fio().create_command() | ||
.io_engine(IoEngine.libaio) | ||
.block_size(Size(1, Unit.Blocks4096), Size(1, Unit.Blocks512)) | ||
.size(Size(200, Unit.MebiByte)) | ||
.direct(False) | ||
.read_write(fio_write) | ||
.verify(VerifyMethod.pattern) | ||
.verify_pattern(pattern) | ||
.do_verify(write_policy == CacheMode.WA) | ||
.allow_mounted_write() | ||
.rand_seed(TestRun.random_seed) | ||
) | ||
|
||
if verify_only: | ||
fio.verify_only() | ||
|
||
for index, (mount_point, device) in enumerate(mount_point_dict.items()): | ||
fio.add_job(f"job_{index}").directory(mount_point).target(f"fio_test_file_{index}") | ||
fio.add_job().target(unmounted_device_path) | ||
|
||
return fio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of separating it out to the function you can create one Fio
object and then just alter chosen parameters before running it. Alternatively we can think about something like Prototype design pattern.
unmounted_core.path, verify_only=True) | ||
fio.run() | ||
|
||
with TestRun.step("Check in statistics, that all reads are missed"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/missed/misses (cache miss is a noun)
fio.run() | ||
|
||
with TestRun.step("Add 4 cores and mount partitions"): | ||
Udev.disable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling udev is a legitimate step on its own. No need to hide it under core addition.
title: "Verification if metadata is invalidated after removing core device", "Verification if | ||
Open CAS do not keep any information from previous removed core device and do not use them | ||
for new core", pass_criteria: - CAS device do not keep any information from previous removed | ||
core device and do not use them for new core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a mess ;)
No description provided.