-
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 for loading corrupted metadata #1524
base: master
Are you sure you want to change the base?
Add test for loading corrupted metadata #1524
Conversation
f896aa6
to
2664ca8
Compare
""" | ||
title: Security test for loading cache with corrupted metadata. | ||
description: | | ||
Validate the ability of Open CAS to load cache instance and work if metadata is corrupted. |
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.
" "x4->Validate the ability of Open CAS to load cache instance and work if metadata is corrupted.
2664ca8
to
f4753f0
Compare
with TestRun.step("Stop cache."): | ||
cache.stop() | ||
|
||
with TestRun.step("Delete symlinks and unload 'brd' module."): |
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.
Conftest teardown should handle this
|
||
def corrupt_bits(cache_dev: Device, mask: int, offset: int): | ||
output = TestRun.executor.run(f"xxd -bits -len 1 -seek {offset} -postscript {cache_dev.path}") | ||
corrupt_cmd = f"printf '%02x' $((0x{output.stdout}^{mask}))" |
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.
Am I missing something or there is corrupte_cmd declared twice
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
f4753f0
to
5255801
Compare
Original PR: #716
Needs: #1523