Skip to content

Commit

Permalink
tests: update getting metadata size on device in memory consumption test
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
  • Loading branch information
Kamil Gierszewski committed Oct 11, 2024
1 parent d15e1d3 commit be19710
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#
# Copyright(c) 2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

import pytest

from api.cas import casadm
from api.cas.cache_config import CacheLineSize, CacheMode, SeqCutOffPolicy
from api.cas.dmesg import get_metadata_size_on_device
from core.test_run import TestRun
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools.fio.fio import Fio
Expand Down Expand Up @@ -178,8 +180,7 @@ def validate_memory_consumption(cache_device, expected_maximum, actual_size):
"""Checks memory consumption"""
stats = cache_device.get_statistics()
TestRun.LOGGER.info(f"Statistics: {stats}")

stat_footprint = Size(int(cache_device.get_metadata_size()))
stat_footprint = get_metadata_size_on_device(cache_device.cache_id)
TestRun.LOGGER.info(f"Allowed limit for current configuration is: {expected_maximum}")

is_memory_within_limit("Reported Metadata Memory Footprint", expected_maximum, stat_footprint)
Expand Down

0 comments on commit be19710

Please sign in to comment.