Merge "Fix setting of "snapshot_support" extra spec for tempest" into stable/liberty
This commit is contained in:
commit
3b79a76b5d
|
@ -79,9 +79,18 @@ ShareGroup = [
|
||||||
cfg.ListOpt("enable_ro_access_level_for_protocols",
|
cfg.ListOpt("enable_ro_access_level_for_protocols",
|
||||||
default=["nfs", ],
|
default=["nfs", ],
|
||||||
help="List of protocols to run tests with ro access level."),
|
help="List of protocols to run tests with ro access level."),
|
||||||
cfg.StrOpt("storage_protocol",
|
|
||||||
|
# Capabilities
|
||||||
|
cfg.StrOpt("capability_storage_protocol",
|
||||||
|
deprecated_name="storage_protocol",
|
||||||
default="NFS_CIFS",
|
default="NFS_CIFS",
|
||||||
help="Backend protocol to target when creating volume types."),
|
help="Backend protocol to target when creating volume types."),
|
||||||
|
cfg.BoolOpt("capability_snapshot_support",
|
||||||
|
help="Defines extra spec that satisfies specific back end "
|
||||||
|
"capability called 'snapshot_support' and will be used "
|
||||||
|
"for setting up custom share type. Defaults to value of "
|
||||||
|
"other config option 'run_snapshot_tests'."),
|
||||||
|
|
||||||
cfg.StrOpt("share_network_id",
|
cfg.StrOpt("share_network_id",
|
||||||
default="",
|
default="",
|
||||||
help="Some backend drivers requires share network "
|
help="Some backend drivers requires share network "
|
||||||
|
@ -124,6 +133,8 @@ ShareGroup = [
|
||||||
help="Defines whether to run manage/unmanage tests or not. "
|
help="Defines whether to run manage/unmanage tests or not. "
|
||||||
"These test may leave orphaned resources, so be careful "
|
"These test may leave orphaned resources, so be careful "
|
||||||
"enabling this opt."),
|
"enabling this opt."),
|
||||||
|
|
||||||
|
# Switching ON/OFF test suites filtered by features
|
||||||
cfg.BoolOpt("run_extend_tests",
|
cfg.BoolOpt("run_extend_tests",
|
||||||
default=True,
|
default=True,
|
||||||
help="Defines whether to run share extend tests or not. "
|
help="Defines whether to run share extend tests or not. "
|
||||||
|
@ -147,6 +158,7 @@ ShareGroup = [
|
||||||
cfg.BoolOpt("run_migration_tests",
|
cfg.BoolOpt("run_migration_tests",
|
||||||
default=False,
|
default=False,
|
||||||
help="Enable or disable migration tests."),
|
help="Enable or disable migration tests."),
|
||||||
|
|
||||||
cfg.StrOpt("image_with_share_tools",
|
cfg.StrOpt("image_with_share_tools",
|
||||||
default="manila-service-image",
|
default="manila-service-image",
|
||||||
help="Image name for vm booting with nfs/smb clients tool."),
|
help="Image name for vm booting with nfs/smb clients tool."),
|
||||||
|
|
|
@ -37,5 +37,14 @@ class ManilaTempestPlugin(plugins.TempestPlugin):
|
||||||
config.register_opt_group(conf, config_share.share_group,
|
config.register_opt_group(conf, config_share.share_group,
|
||||||
config_share.ShareGroup)
|
config_share.ShareGroup)
|
||||||
|
|
||||||
|
# NOTE(vponomaryov): set opt 'capability_snapshot_support' by
|
||||||
|
# default equal to opt 'run_snapshot_tests'.
|
||||||
|
if conf.share.capability_snapshot_support is None:
|
||||||
|
conf.set_default(
|
||||||
|
"capability_snapshot_support",
|
||||||
|
conf.share.run_snapshot_tests,
|
||||||
|
group="share",
|
||||||
|
)
|
||||||
|
|
||||||
def get_opt_lists(self):
|
def get_opt_lists(self):
|
||||||
return [(config_share.share_group.name, config_share.ShareGroup)]
|
return [(config_share.share_group.name, config_share.ShareGroup)]
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import six
|
||||||
from tempest import config # noqa
|
from tempest import config # noqa
|
||||||
from tempest import test # noqa
|
from tempest import test # noqa
|
||||||
from tempest_lib.common.utils import data_utils # noqa
|
from tempest_lib.common.utils import data_utils # noqa
|
||||||
|
@ -48,12 +49,16 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
|
||||||
cls.st_name = data_utils.rand_name("manage-st-name")
|
cls.st_name = data_utils.rand_name("manage-st-name")
|
||||||
cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid")
|
cls.st_name_invalid = data_utils.rand_name("manage-st-name-invalid")
|
||||||
cls.extra_specs = {
|
cls.extra_specs = {
|
||||||
'storage_protocol': CONF.share.storage_protocol,
|
'storage_protocol': CONF.share.capability_storage_protocol,
|
||||||
'driver_handles_share_servers': False
|
'driver_handles_share_servers': False,
|
||||||
|
'snapshot_support': six.text_type(
|
||||||
|
CONF.share.capability_snapshot_support),
|
||||||
}
|
}
|
||||||
cls.extra_specs_invalid = {
|
cls.extra_specs_invalid = {
|
||||||
'storage_protocol': CONF.share.storage_protocol,
|
'storage_protocol': CONF.share.capability_storage_protocol,
|
||||||
'driver_handles_share_servers': True
|
'driver_handles_share_servers': True,
|
||||||
|
'snapshot_support': six.text_type(
|
||||||
|
CONF.share.capability_snapshot_support),
|
||||||
}
|
}
|
||||||
|
|
||||||
cls.st = cls.create_share_type(
|
cls.st = cls.create_share_type(
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
|
||||||
share_name = data_utils.rand_name("share")
|
share_name = data_utils.rand_name("share")
|
||||||
shr_type_name = data_utils.rand_name("share-type")
|
shr_type_name = data_utils.rand_name("share-type")
|
||||||
extra_specs = self.add_required_extra_specs_to_dict({
|
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
|
# Create share type
|
||||||
|
|
|
@ -35,7 +35,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
|
||||||
# create share type for share filtering purposes
|
# create share type for share filtering purposes
|
||||||
cls.st_name = data_utils.rand_name("tempest-st-name")
|
cls.st_name = data_utils.rand_name("tempest-st-name")
|
||||||
cls.extra_specs = cls.add_required_extra_specs_to_dict(
|
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(
|
cls.st = cls.create_share_type(
|
||||||
name=cls.st_name,
|
name=cls.st_name,
|
||||||
cleanup_in_class=True,
|
cleanup_in_class=True,
|
||||||
|
@ -163,7 +163,9 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
|
||||||
@test.attr(type=["gate", ])
|
@test.attr(type=["gate", ])
|
||||||
def test_list_shares_with_detail_filter_by_extra_specs(self):
|
def test_list_shares_with_detail_filter_by_extra_specs(self):
|
||||||
filters = {
|
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"]
|
share_type_list = self.shares_client.list_share_types()["share_types"]
|
||||||
|
|
||||||
|
|
|
@ -520,10 +520,12 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_required_extra_specs_to_dict(extra_specs=None):
|
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 = {
|
required = {
|
||||||
"driver_handles_share_servers": value,
|
"driver_handles_share_servers": dhss,
|
||||||
"snapshot_support": 'True',
|
"snapshot_support": snapshot_support,
|
||||||
}
|
}
|
||||||
if extra_specs:
|
if extra_specs:
|
||||||
required.update(extra_specs)
|
required.update(extra_specs)
|
||||||
|
|
Loading…
Reference in New Issue