Files
puppet-nova/spec/classes/nova_volume_iscsi_spec.rb
Dan Bode c9757ec448 require sections are specified in nova_config
This massive code commit actually implements something very simple.

previously, we allowed nova_config to omit a section and assumed that
section was default.

This commit updates the code to require section names for all settings.

This change is being made b/c:
- it better maps to the config on disk
- it is consistent with the other modules

Change-Id: Iae71a4c48ed0f9792566f16f0bf13e61569b46e5
2013-04-12 15:06:58 -07:00

60 lines
1.7 KiB
Ruby

require 'spec_helper'
describe 'nova::volume::iscsi' do
describe 'on debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it { should contain_service('tgtd').with(
'name' => 'tgt',
'provider' => 'upstart',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'stopped',
'enable' => true
)}
it { should contain_package('tgt').with_name('tgt') }
describe 'and more specifically on debian os' do
let :facts do
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
end
it { should contain_service('tgtd').with(
'provider' => nil
)}
end
describe 'and more specifically on debian os with iscsitarget helper' do
let :facts do
{ :osfamily => 'Debian', :operatingsystem => 'Debian' }
end
let :params do
{:iscsi_helper => 'iscsitarget'}
end
it { should contain_package('iscsitarget') }
it { should contain_service('iscsitarget').with_enable(true) }
it { should contain_service('open-iscsi').with_enable(true) }
it { should contain_package('iscsitarget-dkms') }
it { should contain_file('/etc/default/iscsitarget') }
end
it { should contain_nova_config('DEFAULT/volume_group').with_value('nova-volumes') }
it { should_not contain_nova_config('DEFAULT/iscsi_ip_address') }
end
describe 'on rhel' do
let :facts do
{ :osfamily => 'RedHat' }
end
it { should contain_service('tgtd').with(
'name' => 'tgtd',
# FIXME(fc): rspec complains this value is 'nil' in the catalog
#'ensure' => 'stopped',
'enable' => true
)}
it { should contain_package('tgt').with_name('scsi-target-utils')}
end
end