pyocf: add new error OCF error code to test framework

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-07-08 09:22:14 -04:00
parent 636834dae3
commit 0c8bc4cec5
2 changed files with 2 additions and 1 deletions

View File

@ -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()

View File

@ -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)