|
1 | 1 | # |
2 | 2 | # Copyright(c) 2022 Intel Corporation |
3 | | -# Copyright(c) 2024-2025 Huawei Technologies |
| 3 | +# Copyright(c) 2024-2025 Huawei Technologies Co., Ltd. |
4 | 4 | # SPDX-License-Identifier: BSD-3-Clause |
5 | 5 | # |
6 | 6 |
|
|
9 | 9 | from collections import namedtuple |
10 | 10 | from math import isclose |
11 | 11 |
|
| 12 | +from api.cas.casadm_params import StatsFilter |
12 | 13 | from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan |
13 | 14 | from api.cas.ioclass_config import IoClass, default_config_file_path |
14 | 15 | from test_tools.fs_tools import Filesystem, create_directory |
@@ -142,6 +143,7 @@ def test_pinned_ioclasses_eviction(): |
142 | 143 | with TestRun.step("Prepare devices"): |
143 | 144 | cache, core = prepare(core_size=core_size, cache_size=cache_size) |
144 | 145 | cache_line_count = cache.get_statistics().config_stats.cache_size |
| 146 | + cache_free_block = cache.get_statistics(stat_filter=[StatsFilter.usage]).usage_stats.free |
145 | 147 |
|
146 | 148 | with TestRun.step("Mount filesystem"): |
147 | 149 | core.create_filesystem(Filesystem.xfs) |
@@ -190,7 +192,7 @@ def test_pinned_ioclasses_eviction(): |
190 | 192 | with TestRun.step(f"Trigger IO to first pinned class directory"): |
191 | 193 | run_io_dir( |
192 | 194 | f"{io_classes[0].dir_path}/tmp_file", |
193 | | - int((io_classes[0].max_occupancy * cache_size) / Unit.Blocks4096), |
| 195 | + int(io_classes[0].max_occupancy * cache_free_block.get_value(Unit.Blocks4096)), |
194 | 196 | ) |
195 | 197 | first_io_pinned_occupancy = get_io_class_occupancy(cache, io_classes[0].id) |
196 | 198 |
|
|
0 commit comments