| from runtest import conditions |
| import base_section |
| |
| |
| MICROVERSION_RELEASE_MAPPING = { |
| 'pike': |
| { |
| 'min_api_microversion': '2.0', |
| 'max_api_microversion': '2.40' |
| } |
| } |
| |
| |
| class Share(base_section.BaseSection): |
| name = "share" |
| options = [ |
| 'backend_names', |
| 'capability_create_share_from_snapshot_support', |
| 'capability_storage_protocol', |
| 'default_share_type_name', |
| 'enable_ip_rules_for_protocols', |
| 'enable_user_rules_for_protocols', |
| 'enable_protocols', |
| 'max_api_microversion', |
| 'min_api_microversion', |
| 'multitenancy_enabled', |
| 'multi_backend', |
| 'run_ipv6_tests', |
| 'run_mount_snapshot_tests', |
| 'run_migration_with_preserve_snapshots_tests', |
| 'run_driver_assisted_migration_tests', |
| 'run_host_assisted_migration_tests', |
| 'run_replication_tests', |
| 'run_manage_unmanage_snapshot_tests', |
| 'run_manage_unmanage_tests', |
| 'run_share_group_tests', |
| 'run_revert_to_snapshot_tests', |
| 'run_snapshot_tests', |
| 'run_shrink_tests', |
| 'run_quota_tests', |
| 'suppress_errors_in_cleanup', |
| 'share_creation_retry_number', |
| ] |
| |
| @property |
| def backend_names(self): |
| c = conditions.BaseRule('manila.share.enabled', 'eq', True) |
| backend_names = [] |
| backends = self.get_item_when_condition_match( |
| 'manila.share.enabled_share_backends', c) |
| if backends: |
| for item, value in backends.items(): |
| if value.get('enabled', True): |
| backend_names.append(value['name']) |
| return ', '.join(backend_names) |
| |
| @property |
| def capability_create_share_from_snapshot_support(self): |
| pass |
| |
| @property |
| def capability_storage_protocol(self): |
| pass |
| |
| @property |
| def default_share_type_name(self): |
| pass |
| |
| @property |
| def enable_ip_rules_for_protocols(self): |
| pass |
| |
| @property |
| def enable_user_rules_for_protocols(self): |
| pass |
| |
| @property |
| def enable_protocols(self): |
| c = conditions.BaseRule('manila.share.enabled', 'eq', True) |
| proto = self.get_item_when_condition_match( |
| 'manila.share.shares.Share2.share_proto', c) |
| if proto: |
| return proto.lower() |
| |
| @property |
| def multitenancy_enabled(self): |
| c = conditions.BaseRule('manila.share.enabled', 'eq', True) |
| return self.get_item_when_condition_match( |
| 'manila.share.shares.Share2.share_type.dhss', |
| c) or False |
| |
| @property |
| def multi_backend(self): |
| c = conditions.BaseRule('manila.api.enabled', 'eq', True) |
| backends = self.get_item_when_condition_match('manila.share.enabled_share_backends', c) |
| backend_names = [] |
| if backends: |
| for item, value in backends.items(): |
| if value.get('enabled', True): |
| backend_names.append(value['name']) |
| return True if len(backend_names) > 1 else False |
| |
| @property |
| def max_api_microversion(self): |
| c = conditions.BaseRule('manila.api.enabled', 'eq', True) |
| manila_version = self.get_item_when_condition_match('manila.api.version', c) |
| if manila_version: |
| return MICROVERSION_RELEASE_MAPPING[manila_version]['max_api_microversion'] |
| |
| @property |
| def min_api_microversion(self): |
| c = conditions.BaseRule('manila.api.enabled', 'eq', True) |
| manila_version = self.get_item_when_condition_match('manila.api.version', c) |
| if manila_version: |
| return MICROVERSION_RELEASE_MAPPING[manila_version]['min_api_microversion'] |
| |
| @property |
| def run_ipv6_tests(self): |
| pass |
| |
| @property |
| def run_mount_snapshot_tests(self): |
| pass |
| |
| @property |
| def run_migration_with_preserve_snapshots_tests(self): |
| pass |
| |
| @property |
| def run_driver_assisted_migration_tests(self): |
| pass |
| |
| @property |
| def run_host_assisted_migration_tests(self): |
| pass |
| |
| @property |
| def run_replication_tests(self): |
| pass |
| |
| @property |
| def run_manage_unmanage_snapshot_tests(self): |
| pass |
| |
| @property |
| def run_manage_unmanage_tests(self): |
| pass |
| |
| @property |
| def run_share_group_tests(self): |
| pass |
| |
| @property |
| def run_revert_to_snapshot_tests(self): |
| pass |
| |
| @property |
| def run_snapshot_tests(self): |
| pass |
| |
| @property |
| def run_shrink_tests(self): |
| pass |
| |
| @property |
| def run_quota_tests(self): |
| pass |
| |
| # Defines number of retries for share creation. |
| @property |
| def share_creation_retry_number(self): |
| pass |
| |
| # Whether to suppress errors with clean up operation or not. |
| @property |
| def suppress_errors_in_cleanup(self): |
| pass |