API fix for casadm standby init

Cache line size parameter is handled inconsistently in standby init and
start cache methods.

This patch fixes this inconsistency so both methods accept a proper
CacheLineSize object.

Some of the existing tests needed fixing as well, as included in this
patch.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This commit is contained in:
Krzysztof Majzerowicz-Jaszcz
2022-07-05 20:17:08 +02:00
parent e82b07746e
commit 09d36d5e11
5 changed files with 20 additions and 16 deletions

View File

@@ -47,11 +47,15 @@ def standby_init(cache_dev: Device, cache_id: int, cache_line_size: CacheLineSiz
kernel_params: KernelParameters = KernelParameters()):
if kernel_params != KernelParameters.read_current_settings():
reload_kernel_module("cas_cache", kernel_params.get_parameter_dictionary())
_cache_line_size = None if cache_line_size is None else str(
int(cache_line_size.value.get_value(Unit.KibiByte)))
output = TestRun.executor.run(
standby_init_cmd(
cache_dev=cache_dev.path,
cache_id=str(cache_id),
cache_line_size=str(cache_line_size),
cache_line_size=_cache_line_size,
force=force,
shortcut=shortcut,
)