summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAlex Schultz <aschultz@redhat.com>2017-07-27 12:54:30 -0600
committerAlex Schultz <aschultz@redhat.com>2017-07-27 12:54:30 -0600
commit237e613a175fd975bf6679646eaf092ff6725015 (patch)
treed573a1e4b144486d18891ee254529fa86ee04634 /spec
parentab8167978569041e79fd9edbfd66359b528116cd (diff)
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
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb21
-rw-r--r--spec/classes/tripleo_profile_base_nova_libvirt_spec.rb14
-rw-r--r--spec/classes/tripleo_selinux_spec.rb2
3 files changed, 30 insertions, 7 deletions
diff --git a/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb b/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb
index db9e77e..0a9ae80 100644
--- a/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb
@@ -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
diff --git a/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb b/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb
index d9a06b2..0734a0f 100644
--- a/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb
@@ -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')
diff --git a/spec/classes/tripleo_selinux_spec.rb b/spec/classes/tripleo_selinux_spec.rb
index f49f87b..2e017b9 100644
--- a/spec/classes/tripleo_selinux_spec.rb
+++ b/spec/classes/tripleo_selinux_spec.rb
@@ -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