From 316cd469429209f42f8a8e456f6bd2e280d4db10 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Thu, 14 Apr 2022 10:32:59 +0200 Subject: [PATCH] test api: casadm commands for promotion policy Signed-off-by: Michal Mielewczyk --- test/functional/api/cas/cli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/functional/api/cas/cli.py b/test/functional/api/cas/cli.py index 6cd5f9a..82df0d4 100644 --- a/test/functional/api/cas/cli.py +++ b/test/functional/api/cas/cli.py @@ -273,6 +273,22 @@ def set_param_cutoff_cmd(cache_id: str, core_id: str = None, threshold: str = No additional_params=add_params, shortcut=shortcut) +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=None, trigger=None, shortcut: bool = False +): + add_param = "" + if threshold is not None: + add_param += (" -t " if shortcut else " --threshold ") + str(threshold) + if trigger is not None: + add_param += (" -o " if shortcut else " --trigger ") + str(trigger) + + def set_param_cleaning_cmd(cache_id: str, policy: str, shortcut: bool = False): add_params = (" -p " if shortcut else " --policy ") + policy return _set_param_cmd(namespace="cleaning", cache_id=cache_id,