diff --git a/spec/classes/nova_volume_iscsi_spec.rb b/spec/classes/nova_volume_iscsi_spec.rb new file mode 100644 index 00000000..b086a080 --- /dev/null +++ b/spec/classes/nova_volume_iscsi_spec.rb @@ -0,0 +1,45 @@ +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 + + it { should contain_nova_config('volume_group').with_value('nova-volumes') } + it { should_not contain_nova_config('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