diff options
Diffstat (limited to 'spec/classes')
-rw-r--r-- | spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb | 58 | ||||
-rw-r--r-- | spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb (renamed from spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb) | 12 | ||||
-rw-r--r-- | spec/classes/tripleo_profile_base_cinder_volume_spec.rb | 18 | ||||
-rw-r--r-- | spec/classes/tripleo_profile_base_nova_api_spec.rb | 40 | ||||
-rw-r--r-- | spec/classes/tripleo_profile_base_nova_spec.rb | 4 |
5 files changed, 106 insertions, 26 deletions
diff --git a/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb b/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb new file mode 100644 index 0000000..0f12b0a --- /dev/null +++ b/spec/classes/tripleo_profile_base_cinder_scaleio_spec.rb @@ -0,0 +1,58 @@ +# +# Copyright (C) 2016 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::cinder::volume::scaleio' do + shared_examples_for 'tripleo::profile::base::cinder::volume::scaleio' do + before :each do + facts.merge!({ :step => params[:step] }) + end + + context 'with step less than 4' do + let(:params) { { :step => 3 } } + + it 'should do nothing' do + is_expected.to contain_class('tripleo::profile::base::cinder::volume::scaleio') + is_expected.to contain_class('tripleo::profile::base::cinder::volume') + is_expected.to contain_class('tripleo::profile::base::cinder') + is_expected.to_not contain_cinder__backend__scaleio('tripleo_scaleio') + end + end + + context 'with step 4' do + let(:params) { { + :step => 4, + } } + + it 'should trigger complete configuration' do + # TODO(aschultz): check hiera parameters + is_expected.to contain_cinder__backend__scaleio('tripleo_scaleio') + end + end + end + + + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({ :hostname => 'node.example.com' }) + end + + it_behaves_like 'tripleo::profile::base::cinder::volume::scaleio' + end + end +end diff --git a/spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb index 1a188aa..313b87c 100644 --- a/spec/classes/tripleo_profile_base_cinder_volume_eqlx_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_volume_dellps_spec.rb @@ -16,8 +16,8 @@ require 'spec_helper' -describe 'tripleo::profile::base::cinder::volume::eqlx' do - shared_examples_for 'tripleo::profile::base::cinder::volume::eqlx' do +describe 'tripleo::profile::base::cinder::volume::dellps' do + shared_examples_for 'tripleo::profile::base::cinder::volume::dellps' do before :each do facts.merge!({ :step => params[:step] }) end @@ -26,10 +26,10 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do let(:params) { { :step => 3 } } it 'should do nothing' do - is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx') + is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps') is_expected.to contain_class('tripleo::profile::base::cinder::volume') is_expected.to contain_class('tripleo::profile::base::cinder') - is_expected.to_not contain_cinder__backend__eqlx('tripleo_eqlx') + is_expected.to_not contain_cinder__backend__eqlx('tripleo_dellps') end end @@ -40,7 +40,7 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do it 'should trigger complete configuration' do # TODO(aschultz): check hiera parameters - is_expected.to contain_cinder__backend__eqlx('tripleo_eqlx') + is_expected.to contain_cinder__backend__eqlx('tripleo_dellps') end end end @@ -52,7 +52,7 @@ describe 'tripleo::profile::base::cinder::volume::eqlx' do facts.merge({ :hostname => 'node.example.com' }) end - it_behaves_like 'tripleo::profile::base::cinder::volume::eqlx' + it_behaves_like 'tripleo::profile::base::cinder::volume::dellps' end end end diff --git a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb index e0ec9de..f4501c8 100644 --- a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb @@ -74,21 +74,21 @@ describe 'tripleo::profile::base::cinder::volume' do end end - context 'with only eqlx' do + context 'with only dellps' do before :each do params.merge!({ - :cinder_enable_eqlx_backend => true, + :cinder_enable_dellps_backend => true, :cinder_enable_iscsi_backend => false, }) end - it 'should configure only eqlx' do - is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx') + it 'should configure only dellps' do + is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi') is_expected.to contain_class('tripleo::profile::base::cinder::volume') is_expected.to contain_class('tripleo::profile::base::cinder') is_expected.to contain_class('cinder::volume') is_expected.to contain_class('cinder::backends').with( - :enabled_backends => ['tripleo_eqlx'] + :enabled_backends => ['tripleo_dellps'] ) end end @@ -160,7 +160,7 @@ describe 'tripleo::profile::base::cinder::volume' do it 'should configure only user backend' do is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellsc') - is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::eqlx') + is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellps') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::netapp') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::nfs') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::rbd') @@ -178,7 +178,7 @@ describe 'tripleo::profile::base::cinder::volume' do params.merge!({ :cinder_enable_iscsi_backend => true, :cinder_enable_dellsc_backend => true, - :cinder_enable_eqlx_backend => true, + :cinder_enable_dellps_backend => true, :cinder_enable_netapp_backend => true, :cinder_enable_nfs_backend => true, :cinder_enable_rbd_backend => true, @@ -187,7 +187,7 @@ describe 'tripleo::profile::base::cinder::volume' do it 'should configure all backends' do is_expected.to contain_class('tripleo::profile::base::cinder::volume::iscsi') is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellsc') - is_expected.to contain_class('tripleo::profile::base::cinder::volume::eqlx') + is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps') is_expected.to contain_class('tripleo::profile::base::cinder::volume::netapp') is_expected.to contain_class('tripleo::profile::base::cinder::volume::nfs') is_expected.to contain_class('tripleo::profile::base::cinder::volume::rbd') @@ -195,7 +195,7 @@ describe 'tripleo::profile::base::cinder::volume' do is_expected.to contain_class('tripleo::profile::base::cinder') is_expected.to contain_class('cinder::volume') is_expected.to contain_class('cinder::backends').with( - :enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_eqlx', + :enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_dellps', 'tripleo_dellsc', 'tripleo_netapp','tripleo_nfs'] ) end diff --git a/spec/classes/tripleo_profile_base_nova_api_spec.rb b/spec/classes/tripleo_profile_base_nova_api_spec.rb index def4f4e..2072438 100644 --- a/spec/classes/tripleo_profile_base_nova_api_spec.rb +++ b/spec/classes/tripleo_profile_base_nova_api_spec.rb @@ -39,7 +39,7 @@ eos is_expected.to contain_class('tripleo::profile::base::nova') is_expected.to_not contain_class('nova::keystone::authtoken') is_expected.to_not contain_class('nova::api') - #is_expected.to_not contain_class('nova::wsgi::apache_api') + is_expected.to_not contain_class('nova::wsgi::apache_api') is_expected.to_not contain_class('nova::network::neutron') } end @@ -56,25 +56,25 @@ eos is_expected.to contain_class('nova::cell_v2::simple_setup') is_expected.to contain_class('nova::keystone::authtoken') is_expected.to contain_class('nova::api') - #is_expected.to contain_class('nova::wsgi::apache_api') + is_expected.to_not contain_class('nova::wsgi::apache_api') is_expected.to contain_class('nova::network::neutron') } end - context 'with step 3 not on bootstrap node' do + context 'with step 3 on bootstrap node' do let(:params) { { - :step => 3, - :bootstrap_node => 'other.example.com', + :step => 3, + :bootstrap_node => 'node.example.com', } } it { is_expected.to contain_class('tripleo::profile::base::nova::api') is_expected.to contain_class('tripleo::profile::base::nova') - is_expected.to_not contain_class('nova::db::sync_cell_v2') - is_expected.to_not contain_class('nova::keystone::authtoken') - is_expected.to_not contain_class('nova::api') - #is_expected.to_not contain_class('nova::wsgi::apache_api') - is_expected.to_not contain_class('nova::network::neutron') + is_expected.to contain_class('nova::cell_v2::simple_setup') + is_expected.to contain_class('nova::keystone::authtoken') + is_expected.to contain_class('nova::api') + is_expected.to_not contain_class('nova::wsgi::apache_api') + is_expected.to contain_class('nova::network::neutron') } end @@ -88,7 +88,25 @@ eos is_expected.to_not contain_class('nova::db::sync_cell_v2') is_expected.to contain_class('nova::keystone::authtoken') is_expected.to contain_class('nova::api') - #is_expected.to contain_class('nova::wsgi::apache_api') + is_expected.to_not contain_class('nova::wsgi::apache_api') + is_expected.to contain_class('nova::network::neutron') + } + end + + context 'with step 4 not on bootstrap node' do + let(:params) { { + :step => 4, + :bootstrap_node => 'other.example.com', + :nova_api_wsgi_enabled => true, + } } + + it { + is_expected.to contain_class('tripleo::profile::base::nova::api') + is_expected.to contain_class('tripleo::profile::base::nova') + is_expected.to_not contain_class('nova::db::sync_cell_v2') + is_expected.to contain_class('nova::keystone::authtoken') + is_expected.to contain_class('nova::api') + is_expected.to contain_class('nova::wsgi::apache_api') is_expected.to contain_class('nova::network::neutron') } end diff --git a/spec/classes/tripleo_profile_base_nova_spec.rb b/spec/classes/tripleo_profile_base_nova_spec.rb index 8ba78af..68b01e9 100644 --- a/spec/classes/tripleo_profile_base_nova_spec.rb +++ b/spec/classes/tripleo_profile_base_nova_spec.rb @@ -49,6 +49,7 @@ describe 'tripleo::profile::base::nova' do :default_transport_url => 'rabbit://nova:foo@localhost:5672/?ssl=0' ) is_expected.to contain_class('nova::config') + is_expected.to contain_class('nova::placement') is_expected.to contain_class('nova::cache').with( :enabled => true, :backend => 'oslo_cache.memcache_pool', @@ -70,6 +71,7 @@ describe 'tripleo::profile::base::nova' do is_expected.to_not contain_class('nova') is_expected.to_not contain_class('nova::config') is_expected.to_not contain_class('nova::cache') + is_expected.to_not contain_class('nova::placement') } end @@ -86,6 +88,7 @@ describe 'tripleo::profile::base::nova' do is_expected.to contain_class('nova') is_expected.to contain_class('nova::config') is_expected.to contain_class('nova::cache') + is_expected.to contain_class('nova::placement') is_expected.to_not contain_class('nova::migration::libvirt') } end @@ -108,6 +111,7 @@ describe 'tripleo::profile::base::nova' do is_expected.to contain_class('tripleo::profile::base::nova') is_expected.to contain_class('nova') is_expected.to contain_class('nova::config') + is_expected.to contain_class('nova::placement') is_expected.to contain_class('nova::cache') is_expected.to contain_class('nova::migration::libvirt').with( :configure_libvirt => params[:libvirt_enabled], |