Skip to content

Commit

Permalink
Add tests for casadm --set-param and --get-param options check
Browse files Browse the repository at this point in the history
Signed-off-by: Rafal Stefanowski <[email protected]>
  • Loading branch information
Rafal Stefanowski committed Jan 27, 2020
1 parent 445f0cb commit 15c8973
Show file tree
Hide file tree
Showing 3 changed files with 378 additions and 1 deletion.
22 changes: 22 additions & 0 deletions test/functional/api/cas/cache_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ def __eq__(self, other):
and self.wake_up_time == other.wake_up_time
)

@staticmethod
def alru_params_range():
alru_params = FlushParametersAlru()
alru_params.activity_threshold = (500, 1000000)
alru_params.flush_max_buffers = (1, 10000)
alru_params.staleness_time = (1, 3600)
alru_params.wake_up_time = (1, 3600)
return alru_params

@staticmethod
def default_alru_params():
alru_params = FlushParametersAlru()
Expand All @@ -126,6 +135,13 @@ def __eq__(self, other):
and self.wake_up_time == other.wake_up_time
)

@staticmethod
def acp_params_range():
acp_params = FlushParametersAcp()
acp_params.flush_max_buffers = (1, 10000)
acp_params.wake_up_time = (0, 10000)
return acp_params

@staticmethod
def default_acp_params():
acp_params = FlushParametersAcp()
Expand All @@ -139,6 +155,12 @@ def __init__(self, policy=None, threshold=None):
self.policy = policy
self.threshold = threshold

def __eq__(self, other):
return (
self.policy == other.policy
and self.threshold == other.threshold
)

@staticmethod
def default_seq_cut_off_params():
seq_cut_off_params = SeqCutOffParameters()
Expand Down
2 changes: 1 addition & 1 deletion test/functional/api/cas/casadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def set_param_cleaning_acp(cache_id: int, wake_up: int = None, flush_max_buffers
output = TestRun.executor.run(
set_param_cleaning_acp_cmd(
cache_id=str(cache_id),
wake_up=str(wake_up) if wake_up else None,
wake_up=str(wake_up) if wake_up is not None else None,
flush_max_buffers=str(flush_max_buffers) if flush_max_buffers else None))
if output.exit_code != 0:
raise CmdException("Error while setting acp cleaning policy parameters.", output)
Expand Down
Loading

0 comments on commit 15c8973

Please sign in to comment.