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 #716

Closed
wants to merge 2 commits into from

Conversation

Ostrokrzew
Copy link
Contributor

@Ostrokrzew Ostrokrzew commented Mar 2, 2021

Add missing setter for promotion policy in test API
Add test for loading corrupted metadata
Update Test Framework

Needs https://github.com/Open-CAS/test-framework/pull/259

@Ostrokrzew Ostrokrzew added the RFC Request For Comments label Mar 2, 2021
@Ostrokrzew Ostrokrzew force-pushed the load_corrupted_test branch from d45acde to b64a70a Compare March 5, 2021 17:28
@ArkadiuszNeumann
Copy link

retest this please

@karolinavelkaja karolinavelkaja requested a review from Deixx August 12, 2021 12:55
@karolinavelkaja
Copy link
Contributor

retest this please

@CAS-Linux-Jenkins
Copy link

Can one of the admins verify this patch?

Copy link
Contributor

@Deixx Deixx left a comment

Choose a reason for hiding this comment

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

logic should be ok, the corruption could be targeted to specific metadata sectors but even now the test does bring value

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.
Test 200 times for each configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's why I don't like specific numbers in description ;) iteration_per_config = 1000

return casadm.set_param_promotion(self.cache_id, promotion_policy)

def set_params_nhit(self, nhit_params: PromotionParametersNhit):
return casadm.set_param_promotion_nhit(self.cache_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

should pass PromotionParametersNhit to casadm
checks should be against None (trigger can be 0)

return output


def set_param_promotion_nhit(cache_id: int, threshold: int = None, trigger: int = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

should accept PromotionParametersNhit and do proper checks for threshold and trigger against None

Comment on lines +338 to +340
cache_id=cache_id,
threshold=threshold,
trigger=trigger))
Copy link
Contributor

Choose a reason for hiding this comment

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

should pass str to cli

Comment on lines +261 to +275
def set_param_promotion_cmd(cache_id: str, policy: str, shortcut: bool = False):
add_params = (" -p " if shortcut else " --policy ") + policy
return _set_param_cmd(namespace="promotion", cache_id=cache_id,
additional_params=add_params, shortcut=shortcut)


def set_param_promotion_nhit_cmd(cache_id: str, threshold: str = None,
trigger: str = None, shortcut: bool = False):
add_param = ""
if threshold is not None:
add_param += (" -t " if shortcut else " --threshold ") + threshold
if trigger is not None:
add_param += (" -o " if shortcut else " --trigger ") + trigger
return _set_param_cmd(namespace="promotion-nhit", cache_id=cache_id,
additional_params=add_param, shortcut=shortcut)
Copy link
Contributor

Choose a reason for hiding this comment

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

added in Kamil's API PR

@katlapinka
Copy link
Contributor

Moved to #1524

@katlapinka katlapinka closed this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments tests v24.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants