Skip to content

Commit

Permalink
Add rudimentary check for crypt_metadata_allocs
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jul 15, 2024
1 parent ad4f4a6 commit f0220e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ def _check_encryption_information_consistency(self, pool_object_path, metadata):
else:
self.assertNotIn("encrypted", metadata["features"])

def _check_crypt_metadata_allocs(self, metadata):
"""
Check that all metadata allocs exist and are non-zero.
"""
crypt_meta_allocs = metadata["backstore"]["cap"].get("crypt_meta_allocs")
self.assertIsNotNone(crypt_meta_allocs)
self.assertIsInstance(crypt_meta_allocs, list)
self.assertEqual(len(crypt_meta_allocs), 1)

crypt_meta_allocs = crypt_meta_allocs[0]
self.assertIsInstance(crypt_meta_allocs, list)
self.assertEqual(crypt_meta_allocs[0], 0)
self.assertGreater(crypt_meta_allocs[1], 0)

def run_check(self, stop_time):
"""
Run the check.
Expand Down Expand Up @@ -282,6 +296,8 @@ def run_check(self, stop_time):
self._check_thin_meta_allocations(written)

self._check_encryption_information_consistency(object_path, written)
self._check_crypt_metadata_allocs(written)

else:
current_message = (
"" if current_return_code == _OK else current_message
Expand Down

0 comments on commit f0220e7

Please sign in to comment.