Compare commits

..

1 Commits

Author SHA1 Message Date
aec8e7e31c [test] Add unit tests for ACP and ALRU cleaning policy parameters
- Add tests for wake-up and flush-max-buffers parameter validation
- Test parameter boundary values and error conditions
- Cover parameter parsing from configuration strings
- Verify set_param_cleaning_policy commands construction
- Test proper handling of different cleaning policies in configure_cache

These tests ensure the proper validation and handling of cleaning policy
parameters introduced in the previous commits.
2025-04-16 18:56:06 +08:00

View File

@ -568,6 +568,16 @@ def test_set_param_cleaning_policy(mock_run_cmd):
'--flush-max-buffers', '200'
])
# Nop policy
mock_run_cmd.reset_mock()
opencas.casadm.set_param("cleaning", cache_id=3, policy="nop")
mock_run_cmd.assert_called_with([
'/sbin/casadm',
'--set-param', '--name', 'cleaning',
'--cache-id', '3',
'--policy', 'nop'
])
@patch("opencas.casadm.set_param_cleaning_policy")
@patch("opencas.casadm.set_param")