-
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 #716
Conversation
Signed-off-by: Slawomir Jankowski <[email protected]>
Signed-off-by: Slawomir Jankowski <[email protected]>
d45acde
to
b64a70a
Compare
retest this please |
retest this please |
Can one of the admins verify this patch? |
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.
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. |
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.
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, |
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.
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): |
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.
should accept PromotionParametersNhit and do proper checks for threshold and trigger against None
cache_id=cache_id, | ||
threshold=threshold, | ||
trigger=trigger)) |
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.
should pass str to cli
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) |
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.
added in Kamil's API PR
Moved to #1524 |
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