Add tests for casadm --set-param and --get-param options check
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This commit is contained in:
@@ -105,6 +105,15 @@ class FlushParametersAlru:
|
||||
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()
|
||||
@@ -126,6 +135,13 @@ class FlushParametersAcp:
|
||||
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()
|
||||
@@ -139,6 +155,12 @@ class SeqCutOffParameters:
|
||||
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()
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user