From 0c8bc4cec532a17360f945bfa5cb67a37dd6bd16 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Mon, 8 Jul 2019 09:22:14 -0400 Subject: [PATCH] pyocf: add new error OCF error code to test framework Signed-off-by: Michal Mielewczyk --- tests/functional/pyocf/types/shared.py | 1 + tests/functional/tests/basic/test_pyocf.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional/pyocf/types/shared.py b/tests/functional/pyocf/types/shared.py index 6f53dda..2467599 100644 --- a/tests/functional/pyocf/types/shared.py +++ b/tests/functional/pyocf/types/shared.py @@ -20,6 +20,7 @@ class OcfErrorCode(IntEnum): OCF_ERR_NO_LOCK = auto() OCF_ERR_METADATA_VER = auto() OCF_ERR_NO_METADATA = auto() + OCF_ERR_METADATA_FOUND = auto() OCF_ERR_INVAL_VOLUME_TYPE = auto() OCF_ERR_UNKNOWN = auto() OCF_ERR_TOO_MANY_CACHES = auto() diff --git a/tests/functional/tests/basic/test_pyocf.py b/tests/functional/tests/basic/test_pyocf.py index 172bce6..872d187 100644 --- a/tests/functional/tests/basic/test_pyocf.py +++ b/tests/functional/tests/basic/test_pyocf.py @@ -62,7 +62,7 @@ def test_start_corrupted_metadata_lba(pyocf_ctx): def test_load_cache_no_preexisting_data(pyocf_ctx): cache_device = Volume(S.from_MiB(30)) - with pytest.raises(OcfError, match="OCF_ERR_START_CACHE_FAIL"): + with pytest.raises(OcfError, match="OCF_ERR_NO_METADATA"): cache = Cache.load_from_device(cache_device)