Skip to content

Commit

Permalink
Add spec tests for nova::volume::iscsi
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Bode committed May 25, 2012
1 parent aecaf74 commit f875b57
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions spec/classes/nova_volume_iscsi_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f875b57

Please sign in to comment.