11#
22# Copyright(c) 2019-2021 Intel Corporation
3- # Copyright(c) 2024 Huawei Technologies Co., Ltd.
3+ # Copyright(c) 2024-2025 Huawei Technologies Co., Ltd.
44# SPDX-License-Identifier: BSD-3-Clause
55#
66
7- import pytest
87from random import randint
98
9+ import pytest
10+
1011from api .cas import casadm , casadm_parser , cli_messages
1112from api .cas .cli import start_cmd
1213from core .test_run import TestRun
@@ -126,9 +127,9 @@ def test_cli_add_remove_default_id(shortcut):
126127
127128 with TestRun .step ("Check if the core is added to the cache." ):
128129 caches = casadm_parser .get_caches ()
129- if len (caches [0 ].get_core_devices ()) != 1 :
130+ if len (caches [0 ].get_cores ()) != 1 :
130131 TestRun .fail ("One core should be present in the cache." )
131- if caches [0 ].get_core_devices ()[0 ].path != core .path :
132+ if caches [0 ].get_cores ()[0 ].path != core .path :
132133 TestRun .fail ("The core path should be equal to the path of the core added." )
133134
134135 with TestRun .step ("Remove the core from the cache." ):
@@ -138,7 +139,7 @@ def test_cli_add_remove_default_id(shortcut):
138139 caches = casadm_parser .get_caches ()
139140 if len (caches ) != 1 :
140141 TestRun .fail ("One cache should be still present after removing the core." )
141- if len (caches [0 ].get_core_devices ()) != 0 :
142+ if len (caches [0 ].get_cores ()) != 0 :
142143 TestRun .fail ("No core device should be present after removing the core." )
143144
144145 with TestRun .step ("Stop the cache." ):
@@ -179,9 +180,9 @@ def test_cli_add_remove_custom_id(shortcut):
179180
180181 with TestRun .step ("Check if the core is added to the cache." ):
181182 caches = casadm_parser .get_caches ()
182- if len (caches [0 ].get_core_devices ()) != 1 :
183+ if len (caches [0 ].get_cores ()) != 1 :
183184 TestRun .fail ("One core should be present in the cache." )
184- if caches [0 ].get_core_devices ()[0 ].path != core .path :
185+ if caches [0 ].get_cores ()[0 ].path != core .path :
185186 TestRun .fail ("The core path should be equal to the path of the core added." )
186187
187188 with TestRun .step ("Remove the core from the cache." ):
@@ -191,7 +192,7 @@ def test_cli_add_remove_custom_id(shortcut):
191192 caches = casadm_parser .get_caches ()
192193 if len (caches ) != 1 :
193194 TestRun .fail ("One cache should be still present after removing the core." )
194- if len (caches [0 ].get_core_devices ()) != 0 :
195+ if len (caches [0 ].get_cores ()) != 0 :
195196 TestRun .fail ("No core device should be present after removing the core." )
196197
197198 with TestRun .step ("Stop the cache." ):
0 commit comments