Powermax Config Fixes

Fixing the issues with Powermax config
and unit tests

Change-Id: Idf5c2f3a9f00833baee4299b8147427938a28df9
This commit is contained in:
rajinir 2020-04-30 14:48:02 -05:00
parent ca3ce73676
commit d9cae95f0a
3 changed files with 20 additions and 17 deletions

View File

@ -33,7 +33,7 @@
# Defaults to hiera('step')
#
class tripleo::profile::base::cinder::volume::dellemc_powermax (
$backend_name = hiera('cinder::backend::dellemc_powermax::volume_backend_name', ['tripleo_dellemc_powermx']),
$backend_name = hiera('cinder::backend::dellemc_powermax::volume_backend_name', ['tripleo_dellemc_powermax']),
$multi_config = hiera('cinder::backend::dellemc_powermax::volume_multi_config', {}),
$step = Integer(hiera('step')),
) {
@ -51,7 +51,7 @@ class tripleo::profile::base::cinder::volume::dellemc_powermax (
'CinderPowermaxPortGroups' => hiera('cinder::backend::dellemc_powermax::powermax_port_groups', undef),
}
$backend_name.each |String $backend| {
any2array($backend_name).each |String $backend| {
$backend_config = merge($backend_defaults, pick($multi_config[$backend], {}))
cinder::backend::dellemc_powermax { $backend :

View File

@ -40,9 +40,8 @@ describe 'tripleo::profile::base::cinder::volume::dellemc_powermax' do
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__dellemc_powermax('tripleo_dellemc_powermax')
end
end
context 'with multiple backends' do
context 'with multiple backends' do
let(:params) { {
:backend_name => ['tripleo_dellemc_powermax_1', 'tripleo_dellemc_powermax_2'],
:multi_config => { 'tripleo_dellemc_powermax_2' => { 'CinderPowermaxStorageProtocol' => 'FC' }},
@ -57,7 +56,9 @@ describe 'tripleo::profile::base::cinder::volume::dellemc_powermax' do
is_expected.to contain_cinder_config('tripleo_dellemc_powermax_2/volume_driver')
.with_value('cinder.volume.drivers.dell_emc.powermax.fc.PowerMaxFCDriver')
end
end
end
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
@ -69,4 +70,3 @@ describe 'tripleo::profile::base::cinder::volume::dellemc_powermax' do
end
end
end
end

View File

@ -299,6 +299,7 @@ describe 'tripleo::profile::base::cinder::volume' do
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellemc_sc')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellsc')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellemc_powermax')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::netapp')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::veritas_hyperscale')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::nfs')
@ -315,15 +316,16 @@ describe 'tripleo::profile::base::cinder::volume' do
context 'with all tripleo backends' do
before :each do
params.merge!({
:cinder_enable_nfs_backend => true,
:cinder_enable_rbd_backend => true,
:cinder_enable_iscsi_backend => true,
:cinder_enable_pure_backend => true,
:cinder_enable_dellemc_sc_backend => true,
:cinder_enable_dellsc_backend => true,
:cinder_enable_dellemc_xtremio_backend => true,
:cinder_enable_netapp_backend => true,
:cinder_enable_vrts_hs_backend => true,
:cinder_enable_nfs_backend => true,
:cinder_enable_rbd_backend => true,
:cinder_enable_iscsi_backend => true,
:cinder_enable_pure_backend => true,
:cinder_enable_dellemc_powermax_backend => true,
:cinder_enable_dellemc_sc_backend => true,
:cinder_enable_dellsc_backend => true,
:cinder_enable_dellemc_xtremio_backend => true,
:cinder_enable_netapp_backend => true,
:cinder_enable_vrts_hs_backend => true,
})
end
it 'should configure all backends' do
@ -332,6 +334,7 @@ describe 'tripleo::profile::base::cinder::volume' do
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_sc')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellsc')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_powermax')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::netapp')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::veritas_hyperscale')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::nfs')
@ -340,8 +343,8 @@ describe 'tripleo::profile::base::cinder::volume' do
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to contain_class('cinder::volume')
is_expected.to contain_class('cinder::backends').with(
:enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_pure', 'tripleo_dellsc', 'tripleo_dellemc_sc', 'tripleo_dellemc_xtremio',
'tripleo_netapp','tripleo_nfs','Veritas_HyperScale']
:enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_pure', 'tripleo_dellsc', 'tripleo_dellemc_sc','tripleo_dellemc_powermax',
'tripleo_dellemc_xtremio', 'tripleo_netapp','tripleo_nfs','Veritas_HyperScale']
)
end
end