From d220aad77bd583bdb57e9677abf7855c9b07033b Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Mon, 22 Mar 2021 18:07:46 +0100 Subject: [PATCH] test: Extend seq cutoff test to validate promotion count Signed-off-by: Robert Baldyga --- test/functional/tests/cli/test_set_get_params.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/functional/tests/cli/test_set_get_params.py b/test/functional/tests/cli/test_set_get_params.py index 6dfef99..168872a 100644 --- a/test/functional/tests/cli/test_set_get_params.py +++ b/test/functional/tests/cli/test_set_get_params.py @@ -232,9 +232,9 @@ def cache_prepare(cache_mode, cache_dev, core_dev): def new_seqcutoff_parameters_random_values(): return SeqCutOffParameters( - threshold = Size(random.randrange(1, 1000000), Unit.KibiByte), - policy = random.choice(list(SeqCutOffPolicy)), - promotion_count = random.randrange(1, 65535) + threshold=Size(random.randrange(1, 1000000), Unit.KibiByte), + policy=random.choice(list(SeqCutOffPolicy)), + 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"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: TestRun.LOGGER.error( f"Sequential cut-off parameters are not correct "