summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-01 23:48:19 +0000
committerGerrit Code Review <review@openstack.org>2015-10-01 23:48:19 +0000
commit3b79a76b5d293bdec677f691c43456a69b1933c0 (patch)
treecc18d8e5eca09ed6fc5c535544f2a3c97bed6858
parent94974038c4d85193c9e0268aa2bde7f026f067b6 (diff)
parent2a6c8d71c97d1d70d3fd3eb7ba3e43a2f92e9a5f (diff)
Merge "Fix setting of "snapshot_support" extra spec for tempest" into stable/liberty1.0.0.0rc2
-rw-r--r--manila_tempest_tests/config.py14
-rw-r--r--manila_tempest_tests/plugin.py9
-rw-r--r--manila_tempest_tests/tests/api/admin/test_share_manage.py13
-rw-r--r--manila_tempest_tests/tests/api/admin/test_share_types.py2
-rw-r--r--manila_tempest_tests/tests/api/admin/test_shares_actions.py6
-rw-r--r--manila_tempest_tests/tests/api/base.py8
6 files changed, 41 insertions, 11 deletions
diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py
index 616cb19..8873ef6 100644
--- a/manila_tempest_tests/config.py
+++ b/manila_tempest_tests/config.py
@@ -79,9 +79,18 @@ ShareGroup = [
79 cfg.ListOpt("enable_ro_access_level_for_protocols", 79 cfg.ListOpt("enable_ro_access_level_for_protocols",
80 default=["nfs", ], 80 default=["nfs", ],
81 help="List of protocols to run tests with ro access level."), 81 help="List of protocols to run tests with ro access level."),
82 cfg.StrOpt("storage_protocol", 82
83 # Capabilities
84 cfg.StrOpt("capability_storage_protocol",
85 deprecated_name="storage_protocol",
83 default="NFS_CIFS", 86 default="NFS_CIFS",
84 help="Backend protocol to target when creating volume types."), 87 help="Backend protocol to target when creating volume types."),
88 cfg.BoolOpt("capability_snapshot_support",
89 help="Defines extra spec that satisfies specific back end "
90 "capability called 'snapshot_support' and will be used "
91 "for setting up custom share type. Defaults to value of "
92 "other config option 'run_snapshot_tests'."),
93
85 cfg.StrOpt("share_network_id", 94 cfg.StrOpt("share_network_id",
86 default="", 95 default="",
87 help="Some backend drivers requires share network " 96 help="Some backend drivers requires share network "
@@ -124,6 +133,8 @@ ShareGroup = [
124 help="Defines whether to run manage/unmanage tests or not. " 133 help="Defines whether to run manage/unmanage tests or not. "
125 "These test may leave orphaned resources, so be careful " 134 "These test may leave orphaned resources, so be careful "
126 "enabling this opt."), 135 "enabling this opt."),
136
137 # Switching ON/OFF test suites filtered by features
127 cfg.BoolOpt("run_extend_tests", 138 cfg.BoolOpt("run_extend_tests",
128 default=True, 139 default=True,
129 help="Defines whether to run share extend tests or not. " 140 help="Defines whether to run share extend tests or not. "
@@ -147,6 +158,7 @@ ShareGroup = [
147 cfg.BoolOpt("run_migration_tests", 158 cfg.BoolOpt("run_migration_tests",
148 default=False, 159 default=False,
149 help="Enable or disable migration tests."), 160 help="Enable or disable migration tests."),
161
150 cfg.StrOpt("image_with_share_tools", 162 cfg.StrOpt("image_with_share_tools",
151 default="manila-service-image", 163 default="manila-service-image",
152 help="Image name for vm booting with nfs/smb clients tool."), 164 help="Image name for vm booting with nfs/smb clients tool."),
diff --git a/manila_tempest_tests/plugin.py b/manila_tempest_tests/plugin.py
index 3a8550b..4880940 100644
--- a/manila_tempest_tests/plugin.py
+++ b/manila_tempest_tests/plugin.py
@@ -37,5 +37,14 @@ class ManilaTempestPlugin(plugins.TempestPlugin):
37 config.register_opt_group(conf, config_share.share_group, 37 config.register_opt_group(conf, config_share.share_group,
38 config_share.ShareGroup) 38 config_share.ShareGroup)
39 39
40 # NOTE(vponomaryov): set opt 'capability_snapshot_support' by
41 # default equal to opt 'run_snapshot_tests'.
42 if conf.share.capability_snapshot_support is None:
43 conf.set_default(
44 "capability_snapshot_support",
45 conf.share.run_snapshot_tests,
46 group="share",
47 )
48
40 def get_opt_lists(self): 49 def get_opt_lists(self):
41 return [(config_share.share_group.name, config_share.ShareGroup)] 50 return [(config_share.share_group.name, config_share.ShareGroup)]
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 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16import six
16from tempest import config # noqa 17from tempest import config # noqa
17from tempest import test # noqa 18from tempest import test # noqa
18from tempest_lib.common.utils import data_utils # noqa 19from tempest_lib.common.utils import data_utils # noqa
@@ -48,12 +49,16 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
48 cls.st_name = data_utils.rand_name("manage-st-name") 49 cls.st_name = data_utils.rand_name("manage-st-name")
49 cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid") 50 cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid")
50 cls.extra_specs = { 51 cls.extra_specs = {
51 'storage_protocol': CONF.share.storage_protocol, 52 'storage_protocol': CONF.share.capability_storage_protocol,
52 'driver_handles_share_servers': False 53 'driver_handles_share_servers': False,
54 'snapshot_support': six.text_type(
55 CONF.share.capability_snapshot_support),
53 } 56 }
54 cls.extra_specs_invalid = { 57 cls.extra_specs_invalid = {
55 'storage_protocol': CONF.share.storage_protocol, 58 'storage_protocol': CONF.share.capability_storage_protocol,
56 'driver_handles_share_servers': True 59 'driver_handles_share_servers': True,
60 'snapshot_support': six.text_type(
61 CONF.share.capability_snapshot_support),
57 } 62 }
58 63
59 cls.st = cls.create_share_type( 64 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 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
93 share_name = data_utils.rand_name("share") 93 share_name = data_utils.rand_name("share")
94 shr_type_name = data_utils.rand_name("share-type") 94 shr_type_name = data_utils.rand_name("share-type")
95 extra_specs = self.add_required_extra_specs_to_dict({ 95 extra_specs = self.add_required_extra_specs_to_dict({
96 "storage_protocol": CONF.share.storage_protocol, 96 "storage_protocol": CONF.share.capability_storage_protocol,
97 }) 97 })
98 98
99 # Create share type 99 # 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 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
35 # create share type for share filtering purposes 35 # create share type for share filtering purposes
36 cls.st_name = data_utils.rand_name("tempest-st-name") 36 cls.st_name = data_utils.rand_name("tempest-st-name")
37 cls.extra_specs = cls.add_required_extra_specs_to_dict( 37 cls.extra_specs = cls.add_required_extra_specs_to_dict(
38 {'storage_protocol': CONF.share.storage_protocol}) 38 {'storage_protocol': CONF.share.capability_storage_protocol})
39 cls.st = cls.create_share_type( 39 cls.st = cls.create_share_type(
40 name=cls.st_name, 40 name=cls.st_name,
41 cleanup_in_class=True, 41 cleanup_in_class=True,
@@ -163,7 +163,9 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
163 @test.attr(type=["gate", ]) 163 @test.attr(type=["gate", ])
164 def test_list_shares_with_detail_filter_by_extra_specs(self): 164 def test_list_shares_with_detail_filter_by_extra_specs(self):
165 filters = { 165 filters = {
166 "extra_specs": {'storage_protocol': CONF.share.storage_protocol} 166 "extra_specs": {
167 "storage_protocol": CONF.share.capability_storage_protocol,
168 }
167 } 169 }
168 share_type_list = self.shares_client.list_share_types()["share_types"] 170 share_type_list = self.shares_client.list_share_types()["share_types"]
169 171
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 @@ class BaseSharesTest(test.BaseTestCase):
520 520
521 @staticmethod 521 @staticmethod
522 def add_required_extra_specs_to_dict(extra_specs=None): 522 def add_required_extra_specs_to_dict(extra_specs=None):
523 value = six.text_type(CONF.share.multitenancy_enabled) 523 dhss = six.text_type(CONF.share.multitenancy_enabled)
524 snapshot_support = six.text_type(
525 CONF.share.capability_snapshot_support)
524 required = { 526 required = {
525 "driver_handles_share_servers": value, 527 "driver_handles_share_servers": dhss,
526 "snapshot_support": 'True', 528 "snapshot_support": snapshot_support,
527 } 529 }
528 if extra_specs: 530 if extra_specs:
529 required.update(extra_specs) 531 required.update(extra_specs)