Fix setting of "snapshot_support" extra spec for tempest

Tempest test module "test_shares_actions.py" uses custom share_type,
but do not allow to redefine extra spec "snapshot_support".
And fails for drivers that do not have snapshot support and report
such capability as "False".

Changes:
- Add new config option called "capability_snapshot_support" that
will be used for each share type created in Tempest by default.
- Make it default to existing config option "run_snapshot_tests"
as they will be equal in most cases. But separate their logic, as
we may want just to disable snapshot tests running tempest locally
and testing some other feature having snapshot support in back end.
- Rename existing config option "storage_protocol" to
"capability_storage_protocol" for consistency with new option. And
keep old name as "deprecated".

Change-Id: I9ba0a9b10ffc3f0fda6094a3f5cad26a2e8a447f
Closes-Bug: #1498858
diff --git a/manila_tempest_tests/tests/api/admin/test_share_manage.py b/manila_tempest_tests/tests/api/admin/test_share_manage.py
index 4100b2e..bb04dc7 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_manage.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_manage.py
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import six
 from tempest import config  # noqa
 from tempest import test  # noqa
 from tempest_lib.common.utils import data_utils  # noqa
@@ -48,12 +49,16 @@
         cls.st_name = data_utils.rand_name("manage-st-name")
         cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid")
         cls.extra_specs = {
-            'storage_protocol': CONF.share.storage_protocol,
-            'driver_handles_share_servers': False
+            'storage_protocol': CONF.share.capability_storage_protocol,
+            'driver_handles_share_servers': False,
+            'snapshot_support': six.text_type(
+                CONF.share.capability_snapshot_support),
         }
         cls.extra_specs_invalid = {
-            'storage_protocol': CONF.share.storage_protocol,
-            'driver_handles_share_servers': True
+            'storage_protocol': CONF.share.capability_storage_protocol,
+            'driver_handles_share_servers': True,
+            'snapshot_support': six.text_type(
+                CONF.share.capability_snapshot_support),
         }
 
         cls.st = cls.create_share_type(
diff --git a/manila_tempest_tests/tests/api/admin/test_share_types.py b/manila_tempest_tests/tests/api/admin/test_share_types.py
index 1f4d6a0..ceed68b 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_types.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_types.py
@@ -93,7 +93,7 @@
         share_name = data_utils.rand_name("share")
         shr_type_name = data_utils.rand_name("share-type")
         extra_specs = self.add_required_extra_specs_to_dict({
-            "storage_protocol": CONF.share.storage_protocol,
+            "storage_protocol": CONF.share.capability_storage_protocol,
         })
 
         # Create share type
diff --git a/manila_tempest_tests/tests/api/admin/test_shares_actions.py b/manila_tempest_tests/tests/api/admin/test_shares_actions.py
index 0ce3d68..5cc41f5 100644
--- a/manila_tempest_tests/tests/api/admin/test_shares_actions.py
+++ b/manila_tempest_tests/tests/api/admin/test_shares_actions.py
@@ -35,7 +35,7 @@
         # create share type for share filtering purposes
         cls.st_name = data_utils.rand_name("tempest-st-name")
         cls.extra_specs = cls.add_required_extra_specs_to_dict(
-            {'storage_protocol': CONF.share.storage_protocol})
+            {'storage_protocol': CONF.share.capability_storage_protocol})
         cls.st = cls.create_share_type(
             name=cls.st_name,
             cleanup_in_class=True,
@@ -163,7 +163,9 @@
     @test.attr(type=["gate", ])
     def test_list_shares_with_detail_filter_by_extra_specs(self):
         filters = {
-            "extra_specs": {'storage_protocol': CONF.share.storage_protocol}
+            "extra_specs": {
+                "storage_protocol": CONF.share.capability_storage_protocol,
+            }
         }
         share_type_list = self.shares_client.list_share_types()["share_types"]
 
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index 825b6e0..3c422b8 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -520,10 +520,12 @@
 
     @staticmethod
     def add_required_extra_specs_to_dict(extra_specs=None):
-        value = six.text_type(CONF.share.multitenancy_enabled)
+        dhss = six.text_type(CONF.share.multitenancy_enabled)
+        snapshot_support = six.text_type(
+            CONF.share.capability_snapshot_support)
         required = {
-            "driver_handles_share_servers": value,
-            "snapshot_support": 'True',
+            "driver_handles_share_servers": dhss,
+            "snapshot_support": snapshot_support,
         }
         if extra_specs:
             required.update(extra_specs)