Update unit tests for nova::compute::libvirt_guests
CentOS 6 and 7 are no longer supported. Update the test cases to cover supported versions. Change-Id: Ie702c0e33ee394e6dde5a5c54aad7ea8806299dd
This commit is contained in:
parent
b4c3c5217c
commit
fe790906a6
@ -7,38 +7,11 @@ describe 'nova::compute::libvirt_guests' do
|
||||
end
|
||||
|
||||
shared_examples 'redhat-nova-compute-libvirt-guests' do
|
||||
before do
|
||||
facts.merge!({ :operatingsystem => 'RedHat', :osfamily => 'RedHat',
|
||||
:operatingsystemrelease => 6.5,
|
||||
:operatingsystemmajrelease => '6' })
|
||||
end
|
||||
|
||||
describe 'with default parameters' do
|
||||
context 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_class('nova::params')}
|
||||
|
||||
it { is_expected.not_to contain_package('libvirt-client') }
|
||||
it { is_expected.not_to contain_service('libvirt-guests') }
|
||||
|
||||
describe 'on rhel 7' do
|
||||
before do
|
||||
facts.merge!({
|
||||
:operatingsystemrelease => 7.0,
|
||||
:operatingsystemmajrelease => '7'
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_service('libvirt-guests')}
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with params' do
|
||||
let :params do
|
||||
{ :enabled => true,
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_file('/etc/sysconfig/libvirt-guests').with(
|
||||
:ensure => 'present',
|
||||
:path => '/etc/sysconfig/libvirt-guests',
|
||||
@ -65,6 +38,19 @@ describe 'nova::compute::libvirt_guests' do
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { is_expected.to_not contain_service('libvirt-guests')}
|
||||
end
|
||||
|
||||
context 'with params' do
|
||||
let :params do
|
||||
{ :enabled=> true }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('libvirt-guests').with(
|
||||
:name => 'libvirt-client',
|
||||
:ensure => 'present'
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_service('libvirt-guests').with(
|
||||
:name => 'libvirt-guests',
|
||||
:enable => true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user