Fix nova and selinux unit tests
The unit tests jobs are failing because of missing pre conditions for the new shared class introduced by Ib233689fdcdda391596d01a21f77bd8e1672ae04. Additionally this change moved some classes around so that the tests are now failing due to duplicate class declarations for nova::compute::libvirt::services. This change moves the include that pulls in the declaration first prior to the include that exists in tripleo::profile::base::nova::libvirt. The selinux test was also failing due to a type issue with the fact being used (boolean vs string) Change-Id: I5bd4b61d6008820729d58f7743e7e61955dd6f51 Closes-Bug: #1707034
This commit is contained in:
parent
ab81679785
commit
237e613a17
|
@ -26,6 +26,8 @@
|
|||
class tripleo::profile::base::nova::libvirt (
|
||||
$step = Integer(hiera('step')),
|
||||
) {
|
||||
include ::tripleo::profile::base::nova::compute_libvirt_shared
|
||||
|
||||
if $step >= 4 {
|
||||
include ::tripleo::profile::base::nova
|
||||
include ::tripleo::profile::base::nova::migration::client
|
||||
|
@ -47,6 +49,4 @@ class tripleo::profile::base::nova::libvirt (
|
|||
|
||||
include ::nova::compute::libvirt::qemu
|
||||
}
|
||||
include ::tripleo::profile::base::nova::compute_libvirt_shared
|
||||
|
||||
}
|
||||
|
|
|
@ -22,12 +22,21 @@ describe 'tripleo::profile::base::nova::compute::libvirt' do
|
|||
context 'with step less than 4' do
|
||||
let(:params) { { :step => 1, } }
|
||||
|
||||
let(:pre_condition) do
|
||||
<<-eos
|
||||
class { '::tripleo::profile::base::nova::compute_libvirt_shared':
|
||||
step => #{params[:step]},
|
||||
}
|
||||
eos
|
||||
end
|
||||
|
||||
|
||||
it {
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute::libvirt')
|
||||
is_expected.to_not contain_class('tripleo::profile::base::nova')
|
||||
is_expected.to_not contain_class('tripleo::profile::base::nova::compute')
|
||||
is_expected.to_not contain_class('nova::compute::libvirt')
|
||||
is_expected.to_not contain_class('nova::compute::libvirt::qemu')
|
||||
is_expected.to_not contain_class('tripleo::profile::base::nova::migration::client')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute_libvirt_shared')
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -38,6 +47,9 @@ describe 'tripleo::profile::base::nova::compute::libvirt' do
|
|||
step => #{params[:step]},
|
||||
oslomsg_rpc_hosts => [ '127.0.0.1' ],
|
||||
}
|
||||
class { '::tripleo::profile::base::nova::compute_libvirt_shared':
|
||||
step => #{params[:step]},
|
||||
}
|
||||
class { '::tripleo::profile::base::nova::compute':
|
||||
step => #{params[:step]},
|
||||
}
|
||||
|
@ -54,10 +66,9 @@ eos
|
|||
|
||||
it {
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute::libvirt')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute')
|
||||
is_expected.to contain_class('nova::compute::libvirt')
|
||||
is_expected.to contain_class('nova::compute::libvirt::qemu')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::migration::client')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute_libvirt_shared')
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,9 +21,16 @@ describe 'tripleo::profile::base::nova::libvirt' do
|
|||
|
||||
context 'with step less than 4' do
|
||||
let(:params) { { :step => 1, } }
|
||||
|
||||
let(:pre_condition) do
|
||||
<<-eos
|
||||
class { '::tripleo::profile::base::nova::compute_libvirt_shared':
|
||||
step => #{params[:step]}
|
||||
}
|
||||
eos
|
||||
end
|
||||
it {
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::libvirt')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute_libvirt_shared')
|
||||
is_expected.to_not contain_class('tripleo::profile::base::nova')
|
||||
is_expected.to_not contain_class('nova::compute::libvirt::services')
|
||||
is_expected.to_not contain_file('/etclibvirt/qemu/networks/autostart/default.xml')
|
||||
|
@ -45,6 +52,9 @@ describe 'tripleo::profile::base::nova::libvirt' do
|
|||
class { '::tripleo::profile::base::nova::migration::client':
|
||||
step => #{params[:step]}
|
||||
}
|
||||
class { '::tripleo::profile::base::nova::compute_libvirt_shared':
|
||||
step => #{params[:step]}
|
||||
}
|
||||
eos
|
||||
end
|
||||
|
||||
|
@ -52,8 +62,10 @@ eos
|
|||
|
||||
it {
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::libvirt')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova::compute_libvirt_shared')
|
||||
is_expected.to contain_class('tripleo::profile::base::nova')
|
||||
is_expected.to contain_class('nova::compute::libvirt::services')
|
||||
is_expected.to contain_class('nova::compute::libvirt::qemu')
|
||||
is_expected.to contain_file('/etc/libvirt/qemu/networks/autostart/default.xml').with_ensure('absent')
|
||||
is_expected.to contain_file('/etc/libvirt/qemu/networks/default.xml').with_ensure('absent')
|
||||
is_expected.to contain_exec('libvirt-default-net-destroy')
|
||||
|
|
|
@ -58,7 +58,7 @@ describe 'tripleo::selinux' do
|
|||
|
||||
context 'with selinux disabled' do
|
||||
before :each do
|
||||
facts.merge!({ :selinux => 'false' })
|
||||
facts.merge!({ :selinux => false })
|
||||
end
|
||||
|
||||
let :params do
|
||||
|
|
Loading…
Reference in New Issue