diff --git a/tempest/api/volume/test_snapshot_metadata.py b/tempest/api/volume/test_snapshot_metadata.py index b8e87f0378..641317a59b 100644 --- a/tempest/api/volume/test_snapshot_metadata.py +++ b/tempest/api/volume/test_snapshot_metadata.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from testtools import matchers + from tempest.api.volume import base from tempest import test @@ -50,12 +52,14 @@ class SnapshotV2MetadataTestJSON(base.BaseVolumeTest): metadata) # Get the metadata of the snapshot body = self.client.show_snapshot_metadata(self.snapshot_id) - self.assertEqual(metadata, body) + self.assertThat(body.items(), matchers.ContainsAll(metadata.items())) + # Delete one item metadata of the snapshot self.client.delete_snapshot_metadata_item( self.snapshot_id, "key1") body = self.client.show_snapshot_metadata(self.snapshot_id) - self.assertEqual(expected, body) + self.assertThat(body.items(), matchers.ContainsAll(expected.items())) + self.assertNotIn("key1", body) @test.idempotent_id('bd2363bc-de92-48a4-bc98-28943c6e4be1') def test_update_snapshot_metadata(self): @@ -70,7 +74,8 @@ class SnapshotV2MetadataTestJSON(base.BaseVolumeTest): metadata) # Get the metadata of the snapshot body = self.client.show_snapshot_metadata(self.snapshot_id) - self.assertEqual(metadata, body) + self.assertThat(body.items(), matchers.ContainsAll(metadata.items())) + # Update metadata item body = self.client.update_snapshot_metadata( self.snapshot_id, update) @@ -93,13 +98,13 @@ class SnapshotV2MetadataTestJSON(base.BaseVolumeTest): metadata) # Get the metadata of the snapshot body = self.client.show_snapshot_metadata(self.snapshot_id) - self.assertEqual(metadata, body) + self.assertThat(body.items(), matchers.ContainsAll(metadata.items())) # Update metadata item body = self.client.update_snapshot_metadata_item( self.snapshot_id, "key3", update_item) # Get the metadata of the snapshot body = self.client.show_snapshot_metadata(self.snapshot_id) - self.assertEqual(expect, body) + self.assertThat(body.items(), matchers.ContainsAll(expect.items())) class SnapshotV1MetadataTestJSON(SnapshotV2MetadataTestJSON):