diff --git a/test/utils_tests/opencas-py-tests/test_cas_config_01.py b/test/utils_tests/opencas-py-tests/test_cas_config_01.py index 8b489f4..f7841a7 100644 --- a/test/utils_tests/opencas-py-tests/test_cas_config_01.py +++ b/test/utils_tests/opencas-py-tests/test_cas_config_01.py @@ -331,7 +331,7 @@ def test_cas_config_get_by_id_path_not_found(mock_listdir, mock_realpath): ), ( [ - "1 /dev/dummy0n1 WT cleaning_policy=acp", + "1 /dev/dummy0n1 WT cleaning_policy=acp,lazy_startup=true", "2 /dev/dummy0n2 pt ioclass_file=mango.csv", "3 /dev/dummy0n3 WA cache_line_size=16", ("4 /dev/dummyc wb cache_line_size=16," diff --git a/test/utils_tests/opencas-py-tests/test_cas_config_cache_01.py b/test/utils_tests/opencas-py-tests/test_cas_config_cache_01.py index 8ba35ea..d7fc572 100644 --- a/test/utils_tests/opencas-py-tests/test_cas_config_cache_01.py +++ b/test/utils_tests/opencas-py-tests/test_cas_config_cache_01.py @@ -204,6 +204,8 @@ def test_cache_config_from_line_missing_ioclass_file( "promotion_policy=Robert'); DROP TABLE Students;--", "promotion_policy=awlays", "promotion_policy=nnhit", + "lazy_startup=yes", + "lazy_startup=absolutely", ], ) @mock.patch("os.path.exists") @@ -240,7 +242,10 @@ def test_cache_config_from_line_parameter_validation_01( "ioclass_file=ioclass.csv,cache_line_size=4,cleaning_policy=nop", "promotion_policy=nhit", "promotion_policy=always", - "ioclass_file=ioclass.csv,cache_line_size=4,cleaning_policy=nop,promotion_policy=always", + "lazy_startup=true", + "lazy_startup=false", + ("ioclass_file=ioclass.csv,cache_line_size=4,cleaning_policy=nop,promotion_policy=always," + "lazy_startup=true"), ], ) @mock.patch("os.path.exists") diff --git a/utils/opencas.py b/utils/opencas.py index d43b0b2..38c92fd 100644 --- a/utils/opencas.py +++ b/utils/opencas.py @@ -253,7 +253,7 @@ class cas_config(object): elif param_name == 'cache_line_size': self.check_cache_line_size_valid(param_value) elif param_name == "lazy_startup": - self.check_lazy_startup(param_value) + self.check_lazy_startup_valid(param_value) else: raise ValueError('{0} is invalid parameter name'.format(param_name)) @@ -286,7 +286,7 @@ class cas_config(object): cleaning_policy)) def check_lazy_startup_valid(self, lazy_startup): - if param_value.lower() not in ["true", "false"]: + if lazy_startup.lower() not in ["true", "false"]: raise ValueError('{0} is invalid lazy_startup value'.format(lazy_startup)) def check_promotion_policy_valid(self, promotion_policy):