Add detach command to test's API and fix for attach command

Signed-off-by: Katarzyna Lapinska <katarzyna.lapinska@intel.com>
This commit is contained in:
Katarzyna Lapinska
2020-08-24 10:39:35 +02:00
parent 9283601d84
commit dfdbd9abbe
2 changed files with 21 additions and 5 deletions

View File

@@ -72,8 +72,9 @@ def remove_detached(core_device: Device, shortcut: bool = False):
return output
def try_add(core_device: Device, cache_id: int):
output = TestRun.executor.run(script_try_add_cmd(str(cache_id), core_device.system_path))
def try_add(core_device: Device, cache_id: int, core_id: int = None):
output = TestRun.executor.run(script_try_add_cmd(str(cache_id), core_device.system_path,
str(core_id) if core_id is not None else None))
if output.exit_code != 0:
raise CmdException("Failed to execute try add script command.", output)
return Core(core_device.system_path, cache_id)
@@ -93,6 +94,13 @@ def purge_core(cache_id: int, core_id: int):
return output
def detach_core(cache_id: int, core_id: int):
output = TestRun.executor.run(script_detach_core_cmd(str(cache_id), str(core_id)))
if output.exit_code != 0:
raise CmdException("Failed to execute detach core script command.", output)
return output
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)
output = TestRun.executor.run(