aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/tripleo_profile_base_aodh_api_spec.rb25
-rw-r--r--spec/classes/tripleo_profile_base_ceilometer_api_spec.rb27
-rw-r--r--spec/classes/tripleo_profile_base_horizon_spec.rb28
-rw-r--r--spec/classes/tripleo_profile_base_kernel_spec.rb59
-rw-r--r--spec/classes/tripleo_profile_base_nova_placement_spec.rb20
5 files changed, 152 insertions, 7 deletions
diff --git a/spec/classes/tripleo_profile_base_aodh_api_spec.rb b/spec/classes/tripleo_profile_base_aodh_api_spec.rb
index a82cf49..27bd735 100644
--- a/spec/classes/tripleo_profile_base_aodh_api_spec.rb
+++ b/spec/classes/tripleo_profile_base_aodh_api_spec.rb
@@ -33,12 +33,35 @@ describe 'tripleo::profile::base::aodh::api' do
end
end
- context 'with step 3' do
+ context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
} }
it 'should trigger complete configuration' do
+ is_expected.not_to contain_class('aodh::api')
+ is_expected.not_to contain_class('aodh::wsgi::apache')
+ end
+ end
+
+ context 'with step 3 and bootstrap' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com'
+ } }
+
+ it 'should trigger complete configuration' do
+ is_expected.to contain_class('aodh::api')
+ is_expected.to contain_class('aodh::wsgi::apache')
+ end
+ end
+
+ context 'with step 4' do
+ let(:params) { {
+ :step => 4,
+ } }
+
+ it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
end
diff --git a/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb b/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb
index cec2b54..9cb657f 100644
--- a/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb
+++ b/spec/classes/tripleo_profile_base_ceilometer_api_spec.rb
@@ -32,9 +32,32 @@ describe 'tripleo::profile::base::ceilometer::api' do
end
end
- context 'with step 3' do
+ context 'with step 3 and not bootstrap' do
let(:params) { {
- :step => 3,
+ :step => 3,
+ } }
+
+ it 'should trigger complete configuration' do
+ is_expected.not_to contain_class('ceilometer::api')
+ is_expected.not_to contain_class('ceilometer::wsgi::apache')
+ end
+ end
+
+ context 'with step 3 and bootstrap' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com'
+ } }
+
+ it 'should trigger complete configuration' do
+ is_expected.to contain_class('ceilometer::api')
+ is_expected.to contain_class('ceilometer::wsgi::apache')
+ end
+ end
+
+ context 'with step 4' do
+ let(:params) { {
+ :step => 4,
} }
it 'should trigger complete configuration' do
diff --git a/spec/classes/tripleo_profile_base_horizon_spec.rb b/spec/classes/tripleo_profile_base_horizon_spec.rb
index fb076b8..d8a672b 100644
--- a/spec/classes/tripleo_profile_base_horizon_spec.rb
+++ b/spec/classes/tripleo_profile_base_horizon_spec.rb
@@ -31,11 +31,37 @@ describe 'tripleo::profile::base::horizon' do
end
end
- context 'with step 3' do
+ context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
} }
+ it 'should not configure anything' do
+ is_expected.to_not contain_class('horizon')
+ is_expected.to_not contain_class('apache::mod::remoteip')
+ is_expected.to_not contain_class('apache::mod::status')
+ end
+ end
+
+ context 'with step 3 and bootstrap' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com'
+ } }
+
+ it 'should trigger complete configuration' do
+ is_expected.to contain_class('horizon')
+ is_expected.to contain_class('apache::mod::remoteip')
+ is_expected.to contain_class('apache::mod::status')
+ end
+ end
+
+ context 'with step 4' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com'
+ } }
+
it 'should trigger complete configuration' do
is_expected.to contain_class('horizon')
is_expected.to contain_class('apache::mod::remoteip')
diff --git a/spec/classes/tripleo_profile_base_kernel_spec.rb b/spec/classes/tripleo_profile_base_kernel_spec.rb
new file mode 100644
index 0000000..4c2aab2
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_kernel_spec.rb
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::kernel' do
+
+ shared_examples_for 'tripleo::profile::base::kernel' do
+ context 'with kernel modules' do
+ let :params do
+ {
+ :module_list => {
+ 'nf_conntrack' => {},
+ }
+ }
+ end
+
+ it 'should load kernel module' do
+ is_expected.to contain_kmod__load('nf_conntrack')
+ end
+ end
+ context 'with sysctl settings' do
+ let :params do
+ {
+ :sysctl_settings => {
+ 'net.ipv4.tcp_keepalive_intvl' => { 'value' => '1'},
+ }
+ }
+ end
+
+ it 'should load kernel module' do
+ is_expected.to contain_sysctl__value('net.ipv4.tcp_keepalive_intvl')
+ end
+ end
+ end
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) {
+ facts
+ }
+
+ it_behaves_like 'tripleo::profile::base::kernel'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_placement_spec.rb b/spec/classes/tripleo_profile_base_nova_placement_spec.rb
index 04e032a..574489e 100644
--- a/spec/classes/tripleo_profile_base_nova_placement_spec.rb
+++ b/spec/classes/tripleo_profile_base_nova_placement_spec.rb
@@ -67,8 +67,7 @@ eos
}
end
-
- context 'with step 3' do
+ context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
} }
@@ -77,15 +76,30 @@ eos
is_expected.to contain_class('tripleo::profile::base::nova::placement')
is_expected.to contain_class('tripleo::profile::base::nova')
is_expected.to contain_class('nova::keystone::authtoken')
+ is_expected.not_to contain_class('nova::wsgi::apache_placement')
+ }
+ end
+
+ context 'with step 3 and bootstrap' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com'
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::placement')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::keystone::authtoken')
is_expected.to contain_class('nova::wsgi::apache_placement')
}
end
- context 'with step 3 with enable_internal_tls and skip generate certs' do
+ context 'with step 3 and bootstrap with enable_internal_tls and skip generate certs' do
let(:params) { {
:step => 3,
:enable_internal_tls => true,
:nova_placement_network => 'bar',
+ :bootstrap_node => 'node.example.com',
:certificates_specs => {
'httpd-bar' => {
'hostname' => 'foo',