
This allows for someone to configure Cinder to use the PureISCSIDriver or PureFCDriver. This can be done either in the default section of the volume config or as a backend definition. For example: class { ‘cinder::volume::pure’: ‘san_ip’ => ‘1.2.3.4’, ‘pure_api_token’ => ‘abcdef123456789, ‘pure_storage_protocol’ => ‘iSCSI’, } or cinder::backend::pure {‘pure-iscsi’, ‘san_ip’ => ‘1.2.3.4’, ‘pure_api_token’ => ‘abcdef123457890’, ‘pure_storage_protocol’ => ‘iSCSI’, } Change-Id: If5aebb1f19f666eb158e337f7609e2503f6eb967
70 lines
2.6 KiB
Ruby
70 lines
2.6 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'cinder::backend::pure' do
|
|
let (:title) { 'pure' }
|
|
|
|
let :req_params do
|
|
{
|
|
:san_ip => '127.0.0.2',
|
|
:pure_api_token => 'abc123def456ghi789'
|
|
}
|
|
end
|
|
|
|
describe 'pure volume driver defaults' do
|
|
let :params do
|
|
req_params
|
|
end
|
|
|
|
it 'configure pure volume driver' do
|
|
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
|
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
|
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
|
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
|
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('false')
|
|
end
|
|
end
|
|
|
|
describe 'pure iscsi volume driver' do
|
|
let :params do
|
|
req_params.merge({
|
|
'pure_storage_protocol' => 'iSCSI',
|
|
'use_chap_auth' => 'true'
|
|
})
|
|
end
|
|
|
|
it 'configure pure volume driver' do
|
|
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver')
|
|
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
|
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
|
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
|
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('true')
|
|
end
|
|
end
|
|
|
|
describe 'pure fc volume driver' do
|
|
let :params do
|
|
req_params.merge({'pure_storage_protocol' => 'FC'})
|
|
end
|
|
|
|
it 'configure pure volume driver' do
|
|
is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureFCDriver')
|
|
is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2')
|
|
is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789')
|
|
is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true')
|
|
is_expected.to contain_cinder_config('pure/use_chap_auth').with_value('false')
|
|
end
|
|
end
|
|
|
|
describe 'pure volume driver with additional configuration' do
|
|
let :params do
|
|
req_params.merge({:extra_options => {'pure_backend/param1' => {'value' => 'value1'}}})
|
|
end
|
|
|
|
it 'configure pure volume with additional configuration' do
|
|
should contain_cinder__backend__pure('pure').with({
|
|
:extra_options => {'pure_backend/param1' => {'value' => 'value1'}}
|
|
})
|
|
end
|
|
end
|
|
|
|
end |