Compare commits

..

1 Commits

Author SHA1 Message Date
5f0a32cddb [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:58:05 +08:00

View File

@ -219,9 +219,6 @@ class cas_config(object):
if not stat.S_ISBLK(mode):
raise ValueError(f'{path} is not block device')
def __str__(self):
return f"cas_config(caches={[str(cache) for cache in self.caches.values()]}, cores={[str(core) for core in self.cores]}, version_tag={self.version_tag})"
class cache_config(object):
def __init__(self, cache_id, device, cache_mode, **params):
self.cache_id = int(cache_id)
@ -230,9 +227,6 @@ class cas_config(object):
self.params = params
self.cores = dict()
def __str__(self):
return f"cache_config(cache_id={self.cache_id}, device={self.device}, cache_mode={self.cache_mode}, params={self.params}, cores={self.cores})"
@classmethod
def from_line(cls, line, allow_incomplete=False):
values = line.split()
@ -393,9 +387,6 @@ class cas_config(object):
self.device = path
self.params = params
def __str__(self):
return f"core_config(cache_id={self.cache_id}, core_id={self.core_id}, device={self.device}, params={self.params})"
@classmethod
def from_line(cls, line, allow_incomplete=False):
values = line.split()
@ -655,12 +646,12 @@ def configure_cache(cache):
)
def add_core(core, try_add):
def add_core(core, attach):
casadm.add_core(
device=core.device,
cache_id=core.cache_id,
core_id=core.core_id,
try_add=try_add)
try_add=attach)
# Another helper functions