Browse Source

Merge "Fix setting of "snapshot_support" extra spec for tempest" into stable/liberty

Jenkins 3 years ago
parent
commit
3b79a76b5d

+ 13
- 1
manila_tempest_tests/config.py View File

@@ -79,9 +79,18 @@ ShareGroup = [
79 79
     cfg.ListOpt("enable_ro_access_level_for_protocols",
80 80
                 default=["nfs", ],
81 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 86
                default="NFS_CIFS",
84 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 94
     cfg.StrOpt("share_network_id",
86 95
                default="",
87 96
                help="Some backend drivers requires share network "
@@ -124,6 +133,8 @@ ShareGroup = [
124 133
                 help="Defines whether to run manage/unmanage tests or not. "
125 134
                      "These test may leave orphaned resources, so be careful "
126 135
                      "enabling this opt."),
136
+
137
+    # Switching ON/OFF test suites filtered by features
127 138
     cfg.BoolOpt("run_extend_tests",
128 139
                 default=True,
129 140
                 help="Defines whether to run share extend tests or not. "
@@ -147,6 +158,7 @@ ShareGroup = [
147 158
     cfg.BoolOpt("run_migration_tests",
148 159
                 default=False,
149 160
                 help="Enable or disable migration tests."),
161
+
150 162
     cfg.StrOpt("image_with_share_tools",
151 163
                default="manila-service-image",
152 164
                help="Image name for vm booting with nfs/smb clients tool."),

+ 9
- 0
manila_tempest_tests/plugin.py View File

@@ -37,5 +37,14 @@ class ManilaTempestPlugin(plugins.TempestPlugin):
37 37
         config.register_opt_group(conf, config_share.share_group,
38 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 49
     def get_opt_lists(self):
41 50
         return [(config_share.share_group.name, config_share.ShareGroup)]

+ 9
- 4
manila_tempest_tests/tests/api/admin/test_share_manage.py View File

@@ -13,6 +13,7 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
+import six
16 17
 from tempest import config  # noqa
17 18
 from tempest import test  # noqa
18 19
 from tempest_lib.common.utils import data_utils  # noqa
@@ -48,12 +49,16 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
48 49
         cls.st_name = data_utils.rand_name("manage-st-name")
49 50
         cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid")
50 51
         cls.extra_specs = {
51
-            'storage_protocol': CONF.share.storage_protocol,
52
-            'driver_handles_share_servers': False
52
+            'storage_protocol': CONF.share.capability_storage_protocol,
53
+            'driver_handles_share_servers': False,
54
+            'snapshot_support': six.text_type(
55
+                CONF.share.capability_snapshot_support),
53 56
         }
54 57
         cls.extra_specs_invalid = {
55
-            'storage_protocol': CONF.share.storage_protocol,
56
-            'driver_handles_share_servers': True
58
+            'storage_protocol': CONF.share.capability_storage_protocol,
59
+            'driver_handles_share_servers': True,
60
+            'snapshot_support': six.text_type(
61
+                CONF.share.capability_snapshot_support),
57 62
         }
58 63
 
59 64
         cls.st = cls.create_share_type(

+ 1
- 1
manila_tempest_tests/tests/api/admin/test_share_types.py View File

@@ -93,7 +93,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
93 93
         share_name = data_utils.rand_name("share")
94 94
         shr_type_name = data_utils.rand_name("share-type")
95 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 99
         # Create share type

+ 4
- 2
manila_tempest_tests/tests/api/admin/test_shares_actions.py View File

@@ -35,7 +35,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
35 35
         # create share type for share filtering purposes
36 36
         cls.st_name = data_utils.rand_name("tempest-st-name")
37 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 39
         cls.st = cls.create_share_type(
40 40
             name=cls.st_name,
41 41
             cleanup_in_class=True,
@@ -163,7 +163,9 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
163 163
     @test.attr(type=["gate", ])
164 164
     def test_list_shares_with_detail_filter_by_extra_specs(self):
165 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 170
         share_type_list = self.shares_client.list_share_types()["share_types"]
169 171
 

+ 5
- 3
manila_tempest_tests/tests/api/base.py View File

@@ -520,10 +520,12 @@ class BaseSharesTest(test.BaseTestCase):
520 520
 
521 521
     @staticmethod
522 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 526
         required = {
525
-            "driver_handles_share_servers": value,
526
-            "snapshot_support": 'True',
527
+            "driver_handles_share_servers": dhss,
528
+            "snapshot_support": snapshot_support,
527 529
         }
528 530
         if extra_specs:
529 531
             required.update(extra_specs)

Loading…
Cancel
Save