Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

katlapinka
Copy link
Contributor

Original PR: #716
Needs: #1523

@katlapinka katlapinka force-pushed the kasiat/loading-corrupted-metadata branch 2 times, most recently from f896aa6 to 2664ca8 Compare September 18, 2024 07:12
Deixx
Deixx previously approved these changes Sep 18, 2024
"""
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.
Copy link

@Kamoppl Kamoppl Sep 18, 2024

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.

with TestRun.step("Stop cache."):
cache.stop()

with TestRun.step("Delete symlinks and unload 'brd' module."):
Copy link

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}))"
Copy link

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>
@katlapinka katlapinka force-pushed the kasiat/loading-corrupted-metadata branch from f4753f0 to 5255801 Compare October 9, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants