Merge "Update unit tests for nova::compute::libvirt_guests"
This commit is contained in:
@@ -7,38 +7,11 @@ describe 'nova::compute::libvirt_guests' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'redhat-nova-compute-libvirt-guests' do
|
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.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(
|
it { is_expected.to contain_file('/etc/sysconfig/libvirt-guests').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:path => '/etc/sysconfig/libvirt-guests',
|
:path => '/etc/sysconfig/libvirt-guests',
|
||||||
@@ -65,6 +38,19 @@ describe 'nova::compute::libvirt_guests' do
|
|||||||
:ensure => 'present'
|
: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(
|
it { is_expected.to contain_service('libvirt-guests').with(
|
||||||
:name => 'libvirt-guests',
|
:name => 'libvirt-guests',
|
||||||
:enable => true,
|
:enable => true,
|
||||||
|
|||||||
Reference in New Issue
Block a user