Merge "Check only for added/deleted metadata entries"

This commit is contained in:
Jenkins 2015-05-31 13:14:17 +00:00 committed by Gerrit Code Review
commit 941c56c543
1 changed files with 10 additions and 5 deletions

View File

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