Remove Nova v3 API config

Nova v3 API has disappeared, and Tempest isn't testing the API on the
gate now. In addition, Nova team is creating a new REST API "Nova v2.1
API + microversions" and the interfaces are different from v3 API.
So it is not necessary to keep Nova v3 API tests in Tempest.
This patch removes the API config.

Change-Id: I6c0dc4ff1b05dcf29aae2937104dacf55384d12f
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 86dda80..f0805c0 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -254,9 +254,6 @@
 # Catalog type of the Compute service. (string value)
 #catalog_type = compute
 
-# Catalog type of the Compute v3 service. (string value)
-#catalog_v3_type = computev3
-
 # The endpoint type to use for the compute service. (string value)
 #endpoint_type = publicURL
 
@@ -394,15 +391,6 @@
 # disabled (list value)
 #api_extensions = all
 
-# If false, skip all nova v3 tests. (boolean value)
-#api_v3 = false
-
-# A list of enabled v3 extensions with a special entry all which
-# indicates every extension is enabled. Each extension should be
-# specified with alias name. Empty list indicates all extensions are
-# disabled (list value)
-#api_v3_extensions = all
-
 # Does the test environment block migration support cinder iSCSI
 # volumes (boolean value)
 #block_migrate_cinder_iscsi = false
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
index 38a623a..bc45da5 100644
--- a/tempest/api/image/v1/test_images.py
+++ b/tempest/api/image/v1/test_images.py
@@ -232,99 +232,6 @@
         self.assertFalse(self.created_set - self.dup_set <= result_set)
 
 
-class ListSnapshotImagesTest(base.BaseV1ImageTest):
-    @classmethod
-    def resource_setup(cls):
-        # This test class only uses nova v3 api to create snapshot
-        # as the similar test which uses nova v2 api already exists
-        # in nova v2 compute images api tests.
-        # Since nova v3 doesn't have images api proxy, this test
-        # class was added in the image api tests.
-        if not CONF.compute_feature_enabled.api_v3:
-            skip_msg = ("%s skipped as nova v3 api is not available" %
-                        cls.__name__)
-            raise cls.skipException(skip_msg)
-        super(ListSnapshotImagesTest, cls).resource_setup()
-        cls.servers_client = cls.os.servers_v3_client
-        cls.servers = []
-        # We add a few images here to test the listing functionality of
-        # the images API
-        cls.snapshot = cls._create_snapshot(
-            'snapshot', CONF.compute.image_ref,
-            CONF.compute.flavor_ref)
-        cls.snapshot_set = set((cls.snapshot,))
-
-        image_file = StringIO.StringIO('*' * 42)
-        _, image = cls.create_image(name="Standard Image",
-                                    container_format='ami',
-                                    disk_format='ami',
-                                    is_public=False, data=image_file)
-        cls.image_id = image['id']
-        cls.client.wait_for_image_status(image['id'], 'active')
-
-    @classmethod
-    def resource_cleanup(cls):
-        for server in getattr(cls, "servers", []):
-            cls.servers_client.delete_server(server['id'])
-        super(ListSnapshotImagesTest, cls).resource_cleanup()
-
-    @classmethod
-    def _create_snapshot(cls, name, image_id, flavor, **kwargs):
-        _, server = cls.servers_client.create_server(
-            name, image_id, flavor, **kwargs)
-        cls.servers.append(server)
-        cls.servers_client.wait_for_server_status(
-            server['id'], 'ACTIVE')
-        resp, _ = cls.servers_client.create_image(server['id'], name)
-        image_id = data_utils.parse_image_id(resp['location'])
-        cls.created_images.append(image_id)
-        cls.client.wait_for_image_status(image_id,
-                                         'active')
-        return image_id
-
-    @test.attr(type='gate')
-    @test.services('compute')
-    def test_index_server_id(self):
-        # The images should contain images filtered by server id
-        _, images = self.client.image_list_detail(
-            {'instance_uuid': self.servers[0]['id']})
-        result_set = set(map(lambda x: x['id'], images))
-        self.assertEqual(self.snapshot_set, result_set)
-
-    @test.attr(type='gate')
-    @test.services('compute')
-    def test_index_type(self):
-        # The list of servers should be filtered by image type
-        params = {'image_type': 'snapshot'}
-        _, images = self.client.image_list_detail(params)
-
-        result_set = set(map(lambda x: x['id'], images))
-        self.assertIn(self.snapshot, result_set)
-
-    @test.attr(type='gate')
-    @test.services('compute')
-    def test_index_limit(self):
-        # Verify only the expected number of results are returned
-        _, images = self.client.image_list_detail(limit=1)
-
-        self.assertEqual(1, len(images))
-
-    @test.attr(type='gate')
-    @test.services('compute')
-    def test_index_by_change_since(self):
-        # Verify an update image is returned
-        # Becoming ACTIVE will modify the updated time
-        # Filter by the image's created time
-        _, image = self.client.get_image_meta(self.snapshot)
-        self.assertEqual(self.snapshot, image['id'])
-        _, images = self.client.image_list_detail(
-            changes_since=image['updated_at'])
-
-        result_set = set(map(lambda x: x['id'], images))
-        self.assertIn(self.image_id, result_set)
-        self.assertNotIn(self.snapshot, result_set)
-
-
 class UpdateImageMetaTest(base.BaseV1ImageTest):
     @classmethod
     def resource_setup(cls):
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index 8707427..21c9894 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -104,13 +104,6 @@
                             not CONF.identity_feature_enabled.api_v3, update)
 
 
-def verify_nova_api_versions(os, update):
-    versions = _get_api_versions(os, 'nova')
-    if CONF.compute_feature_enabled.api_v3 != ('v3.0' in versions):
-        print_and_or_update('api_v3', 'compute_feature_enabled',
-                            not CONF.compute_feature_enabled.api_v3, update)
-
-
 def verify_cinder_api_versions(os, update):
     # Check cinder api versions
     versions = _get_api_versions(os, 'cinder')
@@ -127,7 +120,6 @@
         'cinder': verify_cinder_api_versions,
         'glance': verify_glance_api_versions,
         'keystone': verify_keystone_api_versions,
-        'nova': verify_nova_api_versions,
     }
     if service not in verify:
         return
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index 93f02c9..3066667 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -28,11 +28,7 @@
     """Waits for a server to reach a given status."""
 
     def _get_task_state(body):
-        if client.service == CONF.compute.catalog_v3_type:
-            task_state = body.get("os-extended-status:task_state", None)
-        else:
-            task_state = body.get('OS-EXT-STS:task_state', None)
-        return task_state
+        return body.get('OS-EXT-STS:task_state', None)
 
     # NOTE(afazekas): UNKNOWN status possible on ERROR
     # or in a very early stage.
diff --git a/tempest/config.py b/tempest/config.py
index cc6d626..0d4e08a 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -249,9 +249,6 @@
                choices=['public', 'admin', 'internal',
                         'publicURL', 'adminURL', 'internalURL'],
                help="The endpoint type to use for the compute service."),
-    cfg.StrOpt('catalog_v3_type',
-               default='computev3',
-               help="Catalog type of the Compute v3 service."),
     cfg.StrOpt('path_to_private_key',
                help="Path to a private key file for SSH access to remote "
                     "hosts"),
@@ -278,9 +275,6 @@
                                       title="Enabled Compute Service Features")
 
 ComputeFeaturesGroup = [
-    cfg.BoolOpt('api_v3',
-                default=False,
-                help="If false, skip all nova v3 tests."),
     cfg.BoolOpt('disk_config',
                 default=True,
                 help="If false, skip disk config tests"),
@@ -290,12 +284,6 @@
                      'entry all which indicates every extension is enabled. '
                      'Each extension should be specified with alias name. '
                      'Empty list indicates all extensions are disabled'),
-    cfg.ListOpt('api_v3_extensions',
-                default=['all'],
-                help='A list of enabled v3 extensions with a special entry all'
-                     ' which indicates every extension is enabled. '
-                     'Each extension should be specified with alias name. '
-                     'Empty list indicates all extensions are disabled'),
     cfg.BoolOpt('change_password',
                 default=False,
                 help="Does the test environment support changing the admin "
diff --git a/tempest/test.py b/tempest/test.py
index 6deb42b..d614127 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -194,7 +194,6 @@
     """
     config_dict = {
         'compute': CONF.compute_feature_enabled.api_extensions,
-        'compute_v3': CONF.compute_feature_enabled.api_v3_extensions,
         'volume': CONF.volume_feature_enabled.api_extensions,
         'network': CONF.network_feature_enabled.api_extensions,
         'object': CONF.object_storage_feature_enabled.discoverable_apis,
diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py
index ba69a5d..9ff7481 100644
--- a/tempest/tests/cmd/test_verify_tempest_config.py
+++ b/tempest/tests/cmd/test_verify_tempest_config.py
@@ -15,7 +15,6 @@
 import json
 
 import mock
-from oslo.config import cfg
 
 from tempest.cmd import verify_tempest_config
 from tempest import config
@@ -87,7 +86,7 @@
         self.assertIn('v3.0', versions)
 
     def test_verify_api_versions(self):
-        api_services = ['cinder', 'glance', 'keystone', 'nova']
+        api_services = ['cinder', 'glance', 'keystone']
         fake_os = mock.MagicMock()
         for svc in api_services:
             m = 'verify_%s_api_versions' % svc
@@ -96,7 +95,7 @@
                 verify_mock.assert_called_once_with(fake_os, True)
 
     def test_verify_api_versions_not_implemented(self):
-        api_services = ['cinder', 'glance', 'keystone', 'nova']
+        api_services = ['cinder', 'glance', 'keystone']
         fake_os = mock.MagicMock()
         for svc in api_services:
             m = 'verify_%s_api_versions' % svc
@@ -170,23 +169,6 @@
         print_mock.assert_called_once_with('api_v1', 'volume_feature_enabled',
                                            False, True)
 
-    def test_verify_nova_versions(self):
-        cfg.CONF.set_default('api_v3', True, 'compute-feature-enabled')
-        self.useFixture(mockpatch.PatchObject(
-            verify_tempest_config, '_get_unversioned_endpoint',
-            return_value='http://fake_endpoint:5000'))
-        fake_resp = {'versions': [{'id': 'v2.0'}]}
-        fake_resp = json.dumps(fake_resp)
-        self.useFixture(mockpatch.PatchObject(
-            verify_tempest_config.RAW_HTTP, 'request',
-            return_value=(None, fake_resp)))
-        fake_os = mock.MagicMock()
-        with mock.patch.object(verify_tempest_config,
-                               'print_and_or_update') as print_mock:
-            verify_tempest_config.verify_nova_api_versions(fake_os, True)
-        print_mock.assert_called_once_with('api_v3', 'compute_feature_enabled',
-                                           False, True)
-
     def test_verify_glance_version_no_v2_with_v1_1(self):
         def fake_get_versions():
             return (None, ['v1.1'])