test-api: add string representation of SeqCutOffPolicy

Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
Kamil Gierszewski 2024-10-16 15:26:54 +02:00
parent 4ebc00bac8
commit 908672fd66
No known key found for this signature in database
2 changed files with 11 additions and 4 deletions

View File

@ -72,9 +72,9 @@ class CacheMode(Enum):
class SeqCutOffPolicy(Enum):
full = 0
always = 1
never = 2
full = "full"
always = "always"
never = "never"
DEFAULT = full
@classmethod
@ -85,6 +85,9 @@ class SeqCutOffPolicy(Enum):
raise ValueError(f"{name} is not a valid sequential cut off name")
def __str__(self):
return self.value
class MetadataMode(Enum):
normal = "normal"

View File

@ -173,7 +173,11 @@ def test_activate_incomplete_cache():
TestRun.fail(f"Expected one inactive core. Got {inactive_core_count}")
with TestRun.step("Check if core is in an appropriate state"):
core_status = CoreStatus[get_core_info_by_path(core_dev_path)["status"].lower()]
core_status = CoreStatus[
get_core_info_by_path(core_disk_path=core_dev_path, target_cache_id=cache.cache_id)[
"status"
].lower()
]
if core_status != CoreStatus.inactive:
TestRun.fail(
"The core is in an invalid state. "