test: Extend seq cutoff test to validate promotion count

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2021-03-22 18:07:46 +01:00
parent ff4dca4622
commit d220aad77b

View File

@ -232,9 +232,9 @@ def cache_prepare(cache_mode, cache_dev, core_dev):
def new_seqcutoff_parameters_random_values(): def new_seqcutoff_parameters_random_values():
return SeqCutOffParameters( return SeqCutOffParameters(
threshold = Size(random.randrange(1, 1000000), Unit.KibiByte), threshold=Size(random.randrange(1, 1000000), Unit.KibiByte),
policy = random.choice(list(SeqCutOffPolicy)), policy=random.choice(list(SeqCutOffPolicy)),
promotion_count = random.randrange(1, 65535) promotion_count=random.randrange(1, 65535)
) )
@ -287,6 +287,11 @@ def check_seqcutoff_parameters(core, seqcutoff_params):
f"Policy is {current_seqcutoff_params.policy}, " f"Policy is {current_seqcutoff_params.policy}, "
f"should be {seqcutoff_params.policy}\n" f"should be {seqcutoff_params.policy}\n"
) )
if current_seqcutoff_params.promotion_count != seqcutoff_params.promotion_count:
failed_params += (
f"Promotion count is {current_seqcutoff_params.promotion_count}, "
f"should be {seqcutoff_params.promotion_count}\n"
)
if failed_params: if failed_params:
TestRun.LOGGER.error( TestRun.LOGGER.error(
f"Sequential cut-off parameters are not correct " f"Sequential cut-off parameters are not correct "