Add remove core script command to tests API
Signed-off-by: Katarzyna Lapinska <katarzyna.lapinska@intel.com>
This commit is contained in:
parent
65796836e4
commit
b8158f9ceb
@ -106,6 +106,13 @@ def detach_core(cache_id: int, core_id: int):
|
|||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
def remove_core_with_script_command(cache_id: int, core_id: int, no_flush: bool = False):
|
||||||
|
output = TestRun.executor.run(script_remove_core_cmd(str(cache_id), str(core_id), no_flush))
|
||||||
|
if output.exit_code != 0:
|
||||||
|
raise CmdException("Failed to execute remove core script command.", output)
|
||||||
|
return output
|
||||||
|
|
||||||
|
|
||||||
def reset_counters(cache_id: int, core_id: int = None, shortcut: bool = False):
|
def reset_counters(cache_id: int, core_id: int = None, shortcut: bool = False):
|
||||||
_core_id = None if core_id is None else str(core_id)
|
_core_id = None if core_id is None else str(core_id)
|
||||||
output = TestRun.executor.run(
|
output = TestRun.executor.run(
|
||||||
|
@ -40,6 +40,13 @@ def script_detach_core_cmd(cache_id: str, core_id: str):
|
|||||||
f"--core-id {core_id}"
|
f"--core-id {core_id}"
|
||||||
|
|
||||||
|
|
||||||
|
def script_remove_core_cmd(cache_id: str, core_id: str, no_flush: bool = False):
|
||||||
|
command = f"{casadm_bin} --script --remove-core --cache-id {cache_id} --core-id {core_id}"
|
||||||
|
if no_flush:
|
||||||
|
command += ' --no-flush'
|
||||||
|
return command
|
||||||
|
|
||||||
|
|
||||||
def remove_core_cmd(cache_id: str, core_id: str, force: bool = False, shortcut: bool = False):
|
def remove_core_cmd(cache_id: str, core_id: str, force: bool = False, shortcut: bool = False):
|
||||||
command = f" -R -i {cache_id} -j {core_id}" if shortcut \
|
command = f" -R -i {cache_id} -j {core_id}" if shortcut \
|
||||||
else f" --remove-core --cache-id {cache_id} --core-id {core_id}"
|
else f" --remove-core --cache-id {cache_id} --core-id {core_id}"
|
||||||
|
Loading…
Reference in New Issue
Block a user