Merge "Set volume_driver for iscsi backend explicitly"

This commit is contained in:
Jenkins 2014-10-10 16:51:29 +00:00 committed by Gerrit Code Review
commit c9271e02d0
4 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,7 @@
define cinder::backend::iscsi (
$iscsi_ip_address,
$volume_backend_name = $name,
$volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver',
$volume_group = 'cinder-volumes',
$iscsi_helper = $::cinder::params::iscsi_helper,
) {
@ -18,6 +19,7 @@ define cinder::backend::iscsi (
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/volume_driver": value => $volume_driver;
"${name}/iscsi_ip_address": value => $iscsi_ip_address;
"${name}/iscsi_helper": value => $iscsi_helper;
"${name}/volume_group": value => $volume_group;

View File

@ -1,6 +1,7 @@
#
class cinder::volume::iscsi (
$iscsi_ip_address,
$volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver',
$volume_group = 'cinder-volumes',
$iscsi_helper = $::cinder::params::iscsi_helper,
) {
@ -9,6 +10,7 @@ class cinder::volume::iscsi (
cinder::backend::iscsi { 'DEFAULT':
iscsi_ip_address => $iscsi_ip_address,
volume_driver => $volume_driver,
volume_group => $volume_group,
iscsi_helper => $iscsi_helper
}

View File

@ -16,12 +16,22 @@ describe 'cinder::volume::iscsi' do
req_params
end
it { should contain_cinder_config('DEFAULT/volume_driver').with(
:value => 'cinder.volume.drivers.lvm.LVMISCSIDriver')}
it { should contain_cinder_config('DEFAULT/iscsi_ip_address').with(:value => '127.0.0.2')}
it { should contain_cinder_config('DEFAULT/iscsi_helper').with(:value => 'tgtadm')}
it { should contain_cinder_config('DEFAULT/volume_group').with(:value => 'cinder-volumes')}
end
describe 'with iSER driver' do
let(:params) { req_params.merge(
:volume_driver => 'cinder.volume.drivers.lvm.LVMISERDriver')}
it { should contain_cinder_config('DEFAULT/volume_driver').with(
:value => 'cinder.volume.drivers.lvm.LVMISERDriver')}
end
describe 'with a unsupported iscsi helper' do
let(:params) { req_params.merge(:iscsi_helper => 'fooboozoo')}

View File

@ -23,6 +23,8 @@ describe 'cinder::backend::iscsi' do
it 'should configure iscsi driver' do
should contain_cinder_config('hippo/volume_backend_name').with(
:value => 'hippo')
should contain_cinder_config('hippo/volume_driver').with(
:value => 'cinder.volume.drivers.lvm.LVMISCSIDriver')
should contain_cinder_config('hippo/iscsi_ip_address').with(
:value => '127.0.0.2')
should contain_cinder_config('hippo/iscsi_helper').with(