Adam Litke has uploaded a new change for review.

Change subject: tests: volume_artifacts: validate FileVolumeArtifacts metadata
......................................................................

tests: volume_artifacts: validate FileVolumeArtifacts metadata

We now have the VolumeMetadata class which makes it possible to import
raw volume metadata for the purposes of verification.  Use this
infrastructure to validate the metadata created as part of
FileVolumeArtifacts create() in the same way we already do for
BlockVolumeArtifacts.

Change-Id: I366fd989b1387aa483a74e14dcfdc91b9f422060
Signed-off-by: Adam Litke <[email protected]>
---
M tests/storage_volume_artifacts_test.py
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/56172/1

diff --git a/tests/storage_volume_artifacts_test.py 
b/tests/storage_volume_artifacts_test.py
index 47d3ea5..a0ea93a 100644
--- a/tests/storage_volume_artifacts_test.py
+++ b/tests/storage_volume_artifacts_test.py
@@ -256,10 +256,20 @@
         self.assertEqual(has_volume, os.path.exists(artifacts.volume_path))
 
     def validate_artifacts(self, artifacts, env):
-        self.assertTrue(os.path.exists(artifacts.meta_volatile_path))
+        self.validate_metadata(env, artifacts)
         self.assertTrue(os.path.exists(artifacts.volume_path))
         self.assertTrue(os.path.exists(artifacts.lease_path))
 
+    def validate_metadata(self, env, artifacts):
+        meta_path = artifacts.meta_volatile_path
+        self.assertTrue(os.path.exists(meta_path))
+        md_lines = env.sd_manifest.oop.directReadLines(meta_path)
+        md = volume.VolumeMetadata.from_lines(md_lines)
+
+        # Test a few fields just to check that metadata was written
+        self.assertEqual(artifacts.sd_manifest.sdUUID, md.sd_id)
+        self.assertEqual(artifacts.img_id, md.img_id)
+
     def failure(*args):
         raise ExpectedFailure()
 


-- 
To view, visit https://gerrit.ovirt.org/56172
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I366fd989b1387aa483a74e14dcfdc91b9f422060
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to