Merge "Refactor defaults of manila::backend::dellemc_unity"

This commit is contained in:
Zuul 2022-01-07 23:15:46 +00:00 committed by Gerrit Code Review
commit aa781a31cd
2 changed files with 34 additions and 31 deletions

View File

@ -22,6 +22,9 @@
# [*emc_nas_server*] # [*emc_nas_server*]
# (required) The hostname (or IP address) for the storage system. # (required) The hostname (or IP address) for the storage system.
# #
# [*unity_server_meta_pool*]
# (required) The name of the pool to persist the meta-data of NAS server.
#
# [*emc_share_backend*] # [*emc_share_backend*]
# (optional) Share backend. # (optional) Share backend.
# Defaults to 'unity' # Defaults to 'unity'
@ -36,22 +39,18 @@
# is used as the default for all backends. # is used as the default for all backends.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*unity_server_meta_pool*]
# (optional) The name of the pool to persist the meta-data of NAS server.
# Defaults to None
#
# [*unity_share_data_pools*] # [*unity_share_data_pools*]
# (optional) Comma separated list specifying the name of the pools to be # (optional) Comma separated list specifying the name of the pools to be
# used by this back end. Do not set this option if all storage pools on the # used by this back end. Do not set this option if all storage pools on the
# system can be used. Wild card character is supported # system can be used. Wild card character is supported
# Defaults to None # Defaults to $::os_service_default
# #
# [*unity_ethernet_ports*] # [*unity_ethernet_ports*]
# (optional) Comma separated list specifying the ethernet ports of Unity # (optional) Comma separated list specifying the ethernet ports of Unity
# system that can be used for share. Do not set this option if all ethernet # system that can be used for share. Do not set this option if all ethernet
# ports can be used. Wild card character is supported. Both the normal ethernet # ports can be used. Wild card character is supported. Both the normal ethernet
# port and link aggregation port can be used by Unity share driver. # port and link aggregation port can be used by Unity share driver.
# Defaults to None # Defaults to $::os_service_default
# #
# [*unity_share_server*] # [*unity_share_server*]
# (optional) NAS server used for creating share when driver is in DHSS=False # (optional) NAS server used for creating share when driver is in DHSS=False
@ -97,17 +96,17 @@ define manila::backend::dellemc_unity (
$emc_nas_login, $emc_nas_login,
$emc_nas_password, $emc_nas_password,
$emc_nas_server, $emc_nas_server,
$unity_server_meta_pool,
$emc_share_backend = 'unity', $emc_share_backend = 'unity',
$share_backend_name = $name, $share_backend_name = $name,
$backend_availability_zone = $::os_service_default, $backend_availability_zone = $::os_service_default,
$unity_server_meta_pool = undef, $unity_share_data_pools = $::os_service_default,
$unity_share_data_pools = undef, $unity_ethernet_ports = $::os_service_default,
$unity_ethernet_ports = undef,
$unity_share_server = $::os_service_default, $unity_share_server = $::os_service_default,
$report_default_filter_function = $::os_service_default, $report_default_filter_function = $::os_service_default,
$network_plugin_ipv6_enabled = true, $network_plugin_ipv6_enabled = true,
$emc_ssl_cert_verify = false, $emc_ssl_cert_verify = false,
$emc_ssl_cert_path = undef, $emc_ssl_cert_path = $::os_service_default,
$package_ensure = 'present', $package_ensure = 'present',
) { ) {

View File

@ -4,34 +4,25 @@ describe 'manila::backend::dellemc_unity' do
let(:title) {'dellemc_unity'} let(:title) {'dellemc_unity'}
let :params do let :required_params do
{ {
:driver_handles_share_servers => true, :driver_handles_share_servers => true,
:emc_nas_login => 'admin', :emc_nas_login => 'admin',
:emc_nas_password => 'password', :emc_nas_password => 'password',
:emc_nas_server => '127.0.0.2', :emc_nas_server => '127.0.0.2',
:unity_server_meta_pool => 'pool1', :unity_server_meta_pool => 'pool1',
:unity_share_data_pools => '*',
:unity_ethernet_ports => 'eth1',
:unity_share_server => '192.168.0.1',
:report_default_filter_function => false,
:network_plugin_ipv6_enabled => true,
:emc_ssl_cert_verify => true,
:emc_ssl_cert_path => '/etc/ssl/certs/',
:backend_availability_zone => 'my_zone',
} }
end end
let :default_params do let :default_params do
{ {
:emc_share_backend => 'unity', :emc_share_backend => 'unity',
:unity_server_meta_pool => '<SERVICE DEFAULT>',
:unity_share_data_pools => '<SERVICE DEFAULT>', :unity_share_data_pools => '<SERVICE DEFAULT>',
:unity_ethernet_ports => '<SERVICE DEFAULT>', :unity_ethernet_ports => '<SERVICE DEFAULT>',
:unity_share_server => '<SERVICE DEFAULT>', :unity_share_server => '<SERVICE DEFAULT>',
:report_default_filter_function => '<SERVICE DEFAULT>', :report_default_filter_function => '<SERVICE DEFAULT>',
:network_plugin_ipv6_enabled => '<SERVICE DEFAULT>', :network_plugin_ipv6_enabled => true,
:emc_ssl_cert_verify => '<SERVICE DEFAULT>', :emc_ssl_cert_verify => false,
:emc_ssl_cert_path => '<SERVICE DEFAULT>', :emc_ssl_cert_path => '<SERVICE DEFAULT>',
:backend_availability_zone => '<SERVICE DEFAULT>', :backend_availability_zone => '<SERVICE DEFAULT>',
} }
@ -57,20 +48,33 @@ describe 'manila::backend::dellemc_unity' do
shared_examples 'manila::backend::dellemc_unity' do shared_examples 'manila::backend::dellemc_unity' do
context 'with default parameters' do context 'with default parameters' do
before do let :params do
params = {} required_params
end end
it_configures 'dell emc unity share driver' it_configures 'dell emc unity share driver'
end end
context 'with provided parameters' do context 'with provided parameters' do
let :params do
required_params.merge({
:unity_share_data_pools => '*',
:unity_ethernet_ports => 'eth1',
:unity_share_server => '192.168.0.1',
:report_default_filter_function => false,
:network_plugin_ipv6_enabled => true,
:emc_ssl_cert_verify => true,
:emc_ssl_cert_path => '/etc/ssl/certs/',
:backend_availability_zone => 'my_zone',
})
end
it_configures 'dell emc unity share driver' it_configures 'dell emc unity share driver'
end end
context 'with share server config' do context 'with share server config' do
before do let :params do
params.merge!({ required_params.merge({
:emc_nas_password => true, :emc_nas_password => true,
}) })
end end