Merge "Added script for doing tempest plugin sanity"
diff --git a/releasenotes/notes/add-show-snapshot-metadata-item-api-to-v2-snapshots-client-bd3cbab3c7f0e0b3.yaml b/releasenotes/notes/add-show-snapshot-metadata-item-api-to-v2-snapshots-client-bd3cbab3c7f0e0b3.yaml
new file mode 100644
index 0000000..140df60
--- /dev/null
+++ b/releasenotes/notes/add-show-snapshot-metadata-item-api-to-v2-snapshots-client-bd3cbab3c7f0e0b3.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    Add show snapshot metadata item API to v2 snapshots_client library.
+    This feature enables the possibility to show a snapshot's metadata for
+    a specific key.
diff --git a/releasenotes/notes/add-show-volume-metadata-item-api-to-v2-volumes-client-47d59ecd999ca9df.yaml b/releasenotes/notes/add-show-volume-metadata-item-api-to-v2-volumes-client-47d59ecd999ca9df.yaml
new file mode 100644
index 0000000..49a935c
--- /dev/null
+++ b/releasenotes/notes/add-show-volume-metadata-item-api-to-v2-volumes-client-47d59ecd999ca9df.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    Add show volume metadata item API to v2 volumes_client library.
+    This feature enables the possibility to show a volume's metadata for
+    a specific key.
diff --git a/releasenotes/notes/intermediate-pike-release-2ce492432ff8f012.yaml b/releasenotes/notes/intermediate-pike-release-2ce492432ff8f012.yaml
new file mode 100644
index 0000000..bfebcd9
--- /dev/null
+++ b/releasenotes/notes/intermediate-pike-release-2ce492432ff8f012.yaml
@@ -0,0 +1,4 @@
+---
+prelude: >
+    This is an intermediate release during the Pike development cycle to
+    make new functionality available to plugins and other consumers.
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index 3859e64..705e567 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -29,13 +29,13 @@
 LOG = logging.getLogger(__name__)
 
 
-class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
+class LiveMigrationTest(base.BaseV2ComputeAdminTest):
     max_microversion = '2.24'
     block_migration = None
 
     @classmethod
     def skip_checks(cls):
-        super(LiveBlockMigrationTestJSON, cls).skip_checks()
+        super(LiveMigrationTest, cls).skip_checks()
 
         if not CONF.compute_feature_enabled.live_migration:
             skip_msg = ("%s skipped as live-migration is "
@@ -47,26 +47,10 @@
 
     @classmethod
     def setup_clients(cls):
-        super(LiveBlockMigrationTestJSON, cls).setup_clients()
+        super(LiveMigrationTest, cls).setup_clients()
         cls.admin_hosts_client = cls.os_admin.hosts_client
         cls.admin_migration_client = cls.os_admin.migrations_client
 
-    @classmethod
-    def _get_compute_hostnames(cls):
-        body = cls.admin_hosts_client.list_hosts()['hosts']
-        return [
-            host_record['host_name']
-            for host_record in body
-            if host_record['service'] == 'compute'
-        ]
-
-    def _get_server_details(self, server_id):
-        body = self.admin_servers_client.show_server(server_id)['server']
-        return body
-
-    def _get_host_for_server(self, server_id):
-        return self._get_server_details(server_id)['OS-EXT-SRV-ATTR:host']
-
     def _migrate_server_to(self, server_id, dest_host, volume_backed=False):
         kwargs = dict()
         block_migration = getattr(self, 'block_migration', None)
@@ -79,11 +63,6 @@
             server_id, host=dest_host, block_migration=block_migration,
             **kwargs)
 
-    def _get_host_other_than(self, host):
-        for target_host in self._get_compute_hostnames():
-            if host != target_host:
-                return target_host
-
     def _live_migrate(self, server_id, target_host, state,
                       volume_backed=False):
         self._migrate_server_to(server_id, target_host, volume_backed)
@@ -97,7 +76,7 @@
             if (live_migration['instance_uuid'] == server_id):
                 msg += "\n%s" % live_migration
         msg += "]"
-        self.assertEqual(target_host, self._get_host_for_server(server_id),
+        self.assertEqual(target_host, self.get_host_for_server(server_id),
                          msg)
 
     def _test_live_migration(self, state='ACTIVE', volume_backed=False):
@@ -114,8 +93,8 @@
         # Live migrate an instance to another host
         server_id = self.create_test_server(wait_until="ACTIVE",
                                             volume_backed=volume_backed)['id']
-        source_host = self._get_host_for_server(server_id)
-        destination_host = self._get_host_other_than(source_host)
+        source_host = self.get_host_for_server(server_id)
+        destination_host = self.get_host_other_than(server_id)
 
         if state == 'PAUSED':
             self.admin_servers_client.pause_server(server_id)
@@ -158,8 +137,7 @@
     def test_iscsi_volume(self):
         server = self.create_test_server(wait_until="ACTIVE")
         server_id = server['id']
-        actual_host = self._get_host_for_server(server_id)
-        target_host = self._get_host_other_than(actual_host)
+        target_host = self.get_host_other_than(server_id)
 
         volume = self.create_volume()
 
@@ -174,11 +152,11 @@
         server = self.admin_servers_client.show_server(server_id)['server']
         volume_id2 = server["os-extended-volumes:volumes_attached"][0]["id"]
 
-        self.assertEqual(target_host, self._get_host_for_server(server_id))
+        self.assertEqual(target_host, self.get_host_for_server(server_id))
         self.assertEqual(volume_id1, volume_id2)
 
 
-class LiveBlockMigrationRemoteConsolesV26TestJson(LiveBlockMigrationTestJSON):
+class LiveMigrationRemoteConsolesV26Test(LiveMigrationTest):
     min_microversion = '2.6'
     max_microversion = 'latest'
 
@@ -201,8 +179,8 @@
         hints = {'different_host': server01_id}
         server02_id = self.create_test_server(scheduler_hints=hints,
                                               wait_until='ACTIVE')['id']
-        host01_id = self._get_host_for_server(server01_id)
-        host02_id = self._get_host_for_server(server02_id)
+        host01_id = self.get_host_for_server(server01_id)
+        host02_id = self.get_host_for_server(server02_id)
         self.assertNotEqual(host01_id, host02_id)
 
         # At this step we have 2 instances on different hosts, both with
@@ -216,7 +194,7 @@
         self._migrate_server_to(server01_id, host02_id)
         waiters.wait_for_server_status(self.servers_client,
                                        server01_id, 'ACTIVE')
-        self.assertEqual(host02_id, self._get_host_for_server(server01_id))
+        self.assertEqual(host02_id, self.get_host_for_server(server01_id))
         self._verify_console_interaction(server01_id)
         # At this point, both instances have a valid serial console
         # connection, which means the ports got updated.
@@ -252,7 +230,7 @@
         self.assertIn(data, console_output)
 
 
-class LiveAutoBlockMigrationV225TestJSON(LiveBlockMigrationTestJSON):
+class LiveAutoBlockMigrationV225Test(LiveMigrationTest):
     min_microversion = '2.25'
     max_microversion = 'latest'
     block_migration = 'auto'
diff --git a/tempest/api/compute/admin/test_live_block_migration_negative.py b/tempest/api/compute/admin/test_live_migration_negative.py
similarity index 72%
rename from tempest/api/compute/admin/test_live_block_migration_negative.py
rename to tempest/api/compute/admin/test_live_migration_negative.py
index ab63154..deabbc2 100644
--- a/tempest/api/compute/admin/test_live_block_migration_negative.py
+++ b/tempest/api/compute/admin/test_live_migration_negative.py
@@ -23,10 +23,10 @@
 CONF = config.CONF
 
 
-class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
+class LiveMigrationNegativeTest(base.BaseV2ComputeAdminTest):
     @classmethod
     def skip_checks(cls):
-        super(LiveBlockMigrationNegativeTestJSON, cls).skip_checks()
+        super(LiveMigrationNegativeTest, cls).skip_checks()
         if not CONF.compute_feature_enabled.live_migration:
             raise cls.skipException("Live migration is not enabled")
 
@@ -47,3 +47,17 @@
                           server['id'], target_host)
         waiters.wait_for_server_status(self.servers_client, server['id'],
                                        'ACTIVE')
+
+    @decorators.attr(type=['negative'])
+    @decorators.idempotent_id('6e2f94f5-2ee8-4830-bef5-5bc95bb0795b')
+    def test_live_block_migration_suspended(self):
+        server = self.create_test_server(wait_until="ACTIVE")
+
+        self.admin_servers_client.suspend_server(server['id'])
+        waiters.wait_for_server_status(self.servers_client,
+                                       server['id'], 'SUSPENDED')
+
+        destination_host = self.get_host_other_than(server['id'])
+
+        self.assertRaises(lib_exc.Conflict, self._migrate_server_to,
+                          server['id'], destination_host)
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index ddb035d..feabe35 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -487,3 +487,21 @@
         self.addCleanup(client.wait_for_resource_deletion, flavor['id'])
         self.addCleanup(client.delete_flavor, flavor['id'])
         return flavor
+
+    def get_host_for_server(self, server_id):
+        server_details = self.admin_servers_client.show_server(server_id)
+        return server_details['server']['OS-EXT-SRV-ATTR:host']
+
+    def get_host_other_than(self, server_id):
+        source_host = self.get_host_for_server(server_id)
+
+        list_hosts_resp = self.os_admin.hosts_client.list_hosts()['hosts']
+        hosts = [
+            host_record['host_name']
+            for host_record in list_hosts_resp
+            if host_record['service'] == 'compute'
+        ]
+
+        for target_host in hosts:
+            if source_host != target_host:
+                return target_host
diff --git a/tempest/api/volume/test_snapshot_metadata.py b/tempest/api/volume/test_snapshot_metadata.py
index e54cd65..e6fe25d 100644
--- a/tempest/api/volume/test_snapshot_metadata.py
+++ b/tempest/api/volume/test_snapshot_metadata.py
@@ -81,7 +81,7 @@
         self.assertNotIn("key3", body)
 
     @decorators.idempotent_id('e8ff85c5-8f97-477f-806a-3ac364a949ed')
-    def test_update_snapshot_metadata_item(self):
+    def test_update_show_snapshot_metadata_item(self):
         # Update metadata item for the snapshot
         metadata = {"key1": "value1",
                     "key2": "value2",
@@ -101,6 +101,12 @@
         body = self.snapshots_client.update_snapshot_metadata_item(
             self.snapshot['id'], "key3", meta=update_item)['meta']
         self.assertEqual(update_item, body)
+
+        # Get a specific metadata item of the snapshot
+        body = self.snapshots_client.show_snapshot_metadata_item(
+            self.snapshot['id'], "key3")['meta']
+        self.assertEqual({"key3": expect['key3']}, body)
+
         # Get the metadata of the snapshot
         body = self.snapshots_client.show_snapshot_metadata(
             self.snapshot['id'])['metadata']
diff --git a/tempest/api/volume/test_volume_metadata.py b/tempest/api/volume/test_volume_metadata.py
index 5e9a956..d203b2d 100644
--- a/tempest/api/volume/test_volume_metadata.py
+++ b/tempest/api/volume/test_volume_metadata.py
@@ -70,7 +70,7 @@
                         'Delete one item metadata of the volume failed')
 
     @decorators.idempotent_id('862261c5-8df4-475a-8c21-946e50e36a20')
-    def test_update_volume_metadata_item(self):
+    def test_update_show_volume_metadata_item(self):
         # Update metadata item for the volume
         metadata = {"key1": "value1",
                     "key2": "value2",
@@ -88,6 +88,12 @@
         body = self.volumes_client.update_volume_metadata_item(
             self.volume['id'], "key3", update_item)['meta']
         self.assertEqual(update_item, body)
+
+        # Get a specific metadata item of the volume
+        body = self.volumes_client.show_volume_metadata_item(
+            self.volume['id'], "key3")['meta']
+        self.assertEqual({"key3": expect['key3']}, body)
+
         # Get the metadata of the volume
         body = self.volumes_client.show_volume_metadata(
             self.volume['id'])['metadata']
diff --git a/tempest/lib/services/volume/v2/snapshots_client.py b/tempest/lib/services/volume/v2/snapshots_client.py
index 5f4e7de..4bc2842 100644
--- a/tempest/lib/services/volume/v2/snapshots_client.py
+++ b/tempest/lib/services/volume/v2/snapshots_client.py
@@ -164,6 +164,14 @@
         self.expected_success(200, resp.status)
         return rest_client.ResponseBody(resp, body)
 
+    def show_snapshot_metadata_item(self, snapshot_id, id):
+        """Show metadata item for the snapshot."""
+        url = "snapshots/%s/metadata/%s" % (snapshot_id, id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        self.expected_success(200, resp.status)
+        return rest_client.ResponseBody(resp, body)
+
     def update_snapshot_metadata_item(self, snapshot_id, id, **kwargs):
         """Update metadata item for the snapshot."""
         # TODO(piyush): Current api-site doesn't contain this API description.
diff --git a/tempest/lib/services/volume/v2/volumes_client.py b/tempest/lib/services/volume/v2/volumes_client.py
index cfff16a..d31259f 100644
--- a/tempest/lib/services/volume/v2/volumes_client.py
+++ b/tempest/lib/services/volume/v2/volumes_client.py
@@ -284,6 +284,14 @@
         self.expected_success(200, resp.status)
         return rest_client.ResponseBody(resp, body)
 
+    def show_volume_metadata_item(self, volume_id, id):
+        """Show metadata item for the volume."""
+        url = "volumes/%s/metadata/%s" % (volume_id, id)
+        resp, body = self.get(url)
+        body = json.loads(body)
+        self.expected_success(200, resp.status)
+        return rest_client.ResponseBody(resp, body)
+
     def update_volume_metadata_item(self, volume_id, id, meta_item):
         """Update metadata item for the volume."""
         put_body = json.dumps({'meta': meta_item})
diff --git a/tempest/test.py b/tempest/test.py
index a81b5d7..fc846ff 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -63,7 +63,14 @@
         'compute': CONF.service_available.nova,
         'image': CONF.service_available.glance,
         'volume': CONF.service_available.cinder,
+        # NOTE(masayukig): We have two network services which are neutron and
+        # nova-network. And we have no way to know whether nova-network is
+        # available or not. After the pending removal of nova-network from
+        # nova, we can treat the network/neutron case in the same manner as
+        # the other services.
         'network': True,
+        # NOTE(masayukig): Tempest tests always require the identity service.
+        # So we should set this True here.
         'identity': True,
         'object_storage': CONF.service_available.swift,
     }
diff --git a/tempest/tests/lib/services/volume/v2/test_snapshots_client.py b/tempest/tests/lib/services/volume/v2/test_snapshots_client.py
index 7d656f1..c9f57a0 100644
--- a/tempest/tests/lib/services/volume/v2/test_snapshots_client.py
+++ b/tempest/tests/lib/services/volume/v2/test_snapshots_client.py
@@ -72,6 +72,12 @@
         ]
     }
 
+    FAKE_SNAPSHOT_METADATA_ITEM = {
+        "meta": {
+            "key1": "value1"
+        }
+    }
+
     def setUp(self):
         super(TestSnapshotsClient, self).setUp()
         fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -142,6 +148,15 @@
             self.FAKE_INFO_SNAPSHOT,
             bytes_body, volume_type_id="cbc36478b0bd8e67e89")
 
+    def _test_show_snapshot_metadata_item(self, bytes_body=False):
+        self.check_service_client_function(
+            self.client.show_snapshot_metadata_item,
+            'tempest.lib.common.rest_client.RestClient.get',
+            self.FAKE_SNAPSHOT_METADATA_ITEM,
+            bytes_body,
+            snapshot_id="3fbbcccf-d058-4502-8844-6feeffdf4cb5",
+            id="key1")
+
     def test_create_snapshot_with_str_body(self):
         self._test_create_snapshot()
 
@@ -184,6 +199,12 @@
     def test_update_snapshot_metadata_with_bytes_body(self):
         self._test_update_snapshot_metadata(bytes_body=True)
 
+    def test_show_snapshot_metadata_item_with_str_body(self):
+        self._test_show_snapshot_metadata_item()
+
+    def test_show_snapshot_metadata_item_with_bytes_body(self):
+        self._test_show_snapshot_metadata_item(bytes_body=True)
+
     def test_force_delete_snapshot(self):
         self.check_service_client_function(
             self.client.force_delete_snapshot,
diff --git a/tempest/tests/lib/services/volume/v2/test_transfers_client.py b/tempest/tests/lib/services/volume/v2/test_transfers_client.py
index 0c59bf2..84f4992 100644
--- a/tempest/tests/lib/services/volume/v2/test_transfers_client.py
+++ b/tempest/tests/lib/services/volume/v2/test_transfers_client.py
@@ -13,6 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import copy
+
+import mock
+from oslo_serialization import jsonutils as json
+
 from tempest.lib.services.volume.v2 import transfers_client
 from tempest.tests.lib import fake_auth_provider
 from tempest.tests.lib.services import base
@@ -20,11 +25,14 @@
 
 class TestTransfersClient(base.BaseServiceTest):
 
-    FAKE_LIST_VOLUME_TRANSFERS_WITH_DETAIL = {
-        "transfers": [{
-            "created_at": "2017-04-18T09:10:03.000000",
+    FAKE_VOLUME_TRANSFER_ID = "0e89cdd1-6249-421b-96d8-25fac0623d42"
+
+    FAKE_VOLUME_TRANSFER_INFO = {
+        "transfer": {
+            "id": FAKE_VOLUME_TRANSFER_ID,
+            "name": "fake-volume-transfer",
             "volume_id": "47bf04ef-1ea5-4c5f-a375-430a086d6747",
-            "id": "0e89cdd1-6249-421b-96d8-25fac0623d42",
+            "created_at": "2017-04-18T09:10:03.000000",
             "links": [
                 {
                     "href": "fake-url-1",
@@ -34,9 +42,8 @@
                     "href": "fake-url-2",
                     "rel": "bookmark"
                 }
-            ],
-            "name": "fake-volume-transfer"
-        }]
+            ]
+        }
     }
 
     def setUp(self):
@@ -46,16 +53,106 @@
                                                        'volume',
                                                        'regionOne')
 
-    def _test_list_volume_transfers_with_detail(self, bytes_body=False):
+    def _test_create_volume_transfer(self, bytes_body=False):
+        resp_body = copy.deepcopy(self.FAKE_VOLUME_TRANSFER_INFO)
+        resp_body['transfer'].update({"auth_key": "fake-auth-key"})
+        kwargs = {"name": "fake-volume-transfer",
+                  "volume_id": "47bf04ef-1ea5-4c5f-a375-430a086d6747"}
+        payload = json.dumps({"transfer": kwargs}, sort_keys=True)
+        json_dumps = json.dumps
+
+        # NOTE: Use sort_keys for json.dumps so that the expected and actual
+        # payloads are guaranteed to be identical for mock_args assert check.
+        with mock.patch.object(transfers_client.json, 'dumps') as mock_dumps:
+            mock_dumps.side_effect = lambda d: json_dumps(d, sort_keys=True)
+
+            self.check_service_client_function(
+                self.client.create_volume_transfer,
+                'tempest.lib.common.rest_client.RestClient.post',
+                resp_body,
+                to_utf=bytes_body,
+                status=202,
+                mock_args=['os-volume-transfer', payload],
+                **kwargs)
+
+    def _test_accept_volume_transfer(self, bytes_body=False):
+        resp_body = copy.deepcopy(self.FAKE_VOLUME_TRANSFER_INFO)
+        resp_body['transfer'].pop('created_at')
+        kwargs = {"auth_key": "fake-auth-key"}
+        payload = json.dumps({"accept": kwargs}, sort_keys=True)
+        json_dumps = json.dumps
+
+        # NOTE: Use sort_keys for json.dumps so that the expected and actual
+        # payloads are guaranteed to be identical for mock_args assert check.
+        with mock.patch.object(transfers_client.json, 'dumps') as mock_dumps:
+            mock_dumps.side_effect = lambda d: json_dumps(d, sort_keys=True)
+
+            self.check_service_client_function(
+                self.client.accept_volume_transfer,
+                'tempest.lib.common.rest_client.RestClient.post',
+                resp_body,
+                to_utf=bytes_body,
+                status=202,
+                mock_args=['os-volume-transfer/%s/accept' %
+                           self.FAKE_VOLUME_TRANSFER_ID, payload],
+                transfer_id=self.FAKE_VOLUME_TRANSFER_ID,
+                **kwargs)
+
+    def _test_show_volume_transfer(self, bytes_body=False):
+        resp_body = self.FAKE_VOLUME_TRANSFER_INFO
+        self.check_service_client_function(
+            self.client.show_volume_transfer,
+            'tempest.lib.common.rest_client.RestClient.get',
+            resp_body,
+            to_utf=bytes_body,
+            transfer_id="0e89cdd1-6249-421b-96d8-25fac0623d42")
+
+    def _test_list_volume_transfers(self, detail=False, bytes_body=False):
+        resp_body = copy.deepcopy(self.FAKE_VOLUME_TRANSFER_INFO)
+        if not detail:
+            resp_body['transfer'].pop('created_at')
+        resp_body = {"transfers": [resp_body['transfer']]}
         self.check_service_client_function(
             self.client.list_volume_transfers,
             'tempest.lib.common.rest_client.RestClient.get',
-            self.FAKE_LIST_VOLUME_TRANSFERS_WITH_DETAIL,
-            bytes_body,
-            detail=True)
+            resp_body,
+            to_utf=bytes_body,
+            detail=detail)
+
+    def test_create_volume_transfer_with_str_body(self):
+        self._test_create_volume_transfer()
+
+    def test_create_volume_transfer_with_bytes_body(self):
+        self._test_create_volume_transfer(bytes_body=True)
+
+    def test_accept_volume_transfer_with_str_body(self):
+        self._test_accept_volume_transfer()
+
+    def test_accept_volume_transfer_with_bytes_body(self):
+        self._test_accept_volume_transfer(bytes_body=True)
+
+    def test_show_volume_transfer_with_str_body(self):
+        self._test_show_volume_transfer()
+
+    def test_show_volume_transfer_with_bytes_body(self):
+        self._test_show_volume_transfer(bytes_body=True)
+
+    def test_list_volume_transfers_with_str_body(self):
+        self._test_list_volume_transfers()
+
+    def test_list_volume_transfers_with_bytes_body(self):
+        self._test_list_volume_transfers(bytes_body=True)
 
     def test_list_volume_transfers_with_detail_with_str_body(self):
-        self._test_list_volume_transfers_with_detail()
+        self._test_list_volume_transfers(detail=True)
 
     def test_list_volume_transfers_with_detail_with_bytes_body(self):
-        self._test_list_volume_transfers_with_detail(bytes_body=True)
+        self._test_list_volume_transfers(detail=True, bytes_body=True)
+
+    def test_delete_volume_transfer(self):
+        self.check_service_client_function(
+            self.client.delete_volume_transfer,
+            'tempest.lib.common.rest_client.RestClient.delete',
+            {},
+            status=202,
+            transfer_id="0e89cdd1-6249-421b-96d8-25fac0623d42")
diff --git a/tempest/tests/lib/services/volume/v2/test_volumes_client.py b/tempest/tests/lib/services/volume/v2/test_volumes_client.py
index 498b963..befb1f6 100644
--- a/tempest/tests/lib/services/volume/v2/test_volumes_client.py
+++ b/tempest/tests/lib/services/volume/v2/test_volumes_client.py
@@ -20,6 +20,12 @@
 
 class TestVolumesClient(base.BaseServiceTest):
 
+    FAKE_VOLUME_METADATA_ITEM = {
+        "meta": {
+            "key1": "value1"
+        }
+    }
+
     def setUp(self):
         super(TestVolumesClient, self).setUp()
         fake_auth = fake_auth_provider.FakeAuthProvider()
@@ -45,8 +51,23 @@
             **kwargs
         )
 
+    def _test_show_volume_metadata_item(self, bytes_body=False):
+        self.check_service_client_function(
+            self.client.show_volume_metadata_item,
+            'tempest.lib.common.rest_client.RestClient.get',
+            self.FAKE_VOLUME_METADATA_ITEM,
+            to_utf=bytes_body,
+            volume_id="a3be971b-8de5-4bdf-bdb8-3d8eb0fb69f8",
+            id="key1")
+
     def test_force_detach_volume_with_str_body(self):
         self._test_force_detach_volume()
 
     def test_force_detach_volume_with_bytes_body(self):
         self._test_force_detach_volume(bytes_body=True)
+
+    def test_show_volume_metadata_item_with_str_body(self):
+        self._test_show_volume_metadata_item()
+
+    def test_show_volume_metadata_item_with_bytes_body(self):
+        self._test_show_volume_metadata_item(bytes_body=True)
diff --git a/test-requirements.txt b/test-requirements.txt
index 04fd878..6a5ea03 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -4,7 +4,7 @@
 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
 # needed for doc build
 sphinx>=1.6.2 # BSD
-openstackdocstheme>=1.11.0  # Apache-2.0
+openstackdocstheme>=1.11.0 # Apache-2.0
 reno!=2.3.1,>=1.8.0 # Apache-2.0
 mock>=2.0 # BSD
 coverage!=4.4,>=4.0 # Apache-2.0