Switch oslo to use rspec-puppet-facts

This change updates puppet-oslo to use rspec-puppet-facts for all rspec
tests.

Change-Id: I88771a90ff534c6055f2c852ab7e6474bf68c7bd
changes/00/303900/2
Alex Schultz 7 years ago
parent 054cee1565
commit 93e94704da
  1. 4
      releasenotes/notes/rspec-puppet-facts-321d238a859527ae.yaml
  2. 3
      spec/classes/oslo_init_spec.rb
  3. 23
      spec/defines/oslo_cache_spec.rb
  4. 4
      spec/defines/oslo_concurrency_spec.rb
  5. 36
      spec/defines/oslo_db_spec.rb
  6. 22
      spec/defines/oslo_log_spec.rb
  7. 22
      spec/defines/oslo_messaging_amqp_spec.rb
  8. 4
      spec/defines/oslo_messaging_default_spec.rb
  9. 4
      spec/defines/oslo_messaging_notifications_spec.rb
  10. 22
      spec/defines/oslo_messaging_rabbit_spec.rb
  11. 4
      spec/defines/oslo_policy_spec.rb
  12. 23
      spec/defines/oslo_versionedobjects_spec.rb

@ -0,0 +1,4 @@
---
other:
- Tests updated to leverage rspec-puppet-facts for testing
multiple OS versions.

@ -8,7 +8,8 @@ describe 'oslo' do
it 'contains the logging class' do
is_expected.to contain_class('oslo::params')
end
end
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::cache' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-cache' do
context 'with default parameters' do
it 'configure oslo_cache default params' do
@ -77,19 +77,14 @@ describe 'oslo::cache' do
end
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
include_examples 'shared examples'
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'oslo-cache'
end
include_examples 'shared examples'
end
end

@ -4,7 +4,7 @@ describe 'oslo::concurrency' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-concurrency' do
context 'with default parameters' do
it 'configures oslo_concurrency default params' do
@ -36,7 +36,7 @@ describe 'oslo::concurrency' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'shared examples'
it_behaves_like 'oslo-concurrency'
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::db' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-db' do
context 'with default parameters' do
it 'configure oslo_db default params' do
@ -137,15 +137,8 @@ describe 'oslo::db' do
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => 'jessie',
})
end
context 'using pymysql driver' do
shared_examples 'oslo-db on Debian' do
context 'using pymysql driver' do
let :params do
{ :connection => 'mysql+pymysql:///db:db@localhost/db', }
end
@ -172,17 +165,9 @@ describe 'oslo::db' do
)
end
end
include_examples 'shared examples'
end
context 'on Redhat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat',
:operatingsystemrelease => '7.1',
})
end
shared_examples 'oslo-db on RedHat' do
context 'using pymysql driver' do
let :params do
{ :connection => 'mysql+pymysql:///db:db@localhost/db', }
@ -190,7 +175,18 @@ describe 'oslo::db' do
it { is_expected.not_to contain_package('db_backend_package') }
end
end
include_examples 'shared examples'
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'oslo-db'
it_behaves_like "oslo-db on #{facts[:osfamily]}"
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::log' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-log' do
context 'with default parameters' do
it 'configure oslo_log default params' do
@ -89,19 +89,15 @@ describe 'oslo::log' do
end
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
include_examples 'shared examples'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_behaves_like 'oslo-log'
end
include_examples 'shared examples'
end
end

@ -4,7 +4,7 @@ describe 'oslo::messaging::amqp' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-messaging-amqp' do
context 'with default parameters' do
it 'configure oslo_messaging_amqp default params' do
@ -47,19 +47,15 @@ describe 'oslo::messaging::amqp' do
end
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
include_examples 'shared examples'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_behaves_like 'oslo-messaging-amqp'
end
include_examples 'shared examples'
end
end

@ -4,7 +4,7 @@ describe 'oslo::messaging::default' do
let (:title) { 'keystone_config' }
shared_examples 'DEFAULT examples' do
shared_examples 'oslo-messaging-default' do
context 'with default parameters' do
it 'configure DEFAULT default params' do
@ -40,7 +40,7 @@ describe 'oslo::messaging::default' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'DEFAULT examples'
it_behaves_like 'oslo-messaging-default'
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::messaging::notifications' do
let (:title) { 'keystone_config' }
shared_examples 'notifications examples' do
shared_examples 'oslo-messaging-notifications' do
context 'with default parameters' do
it 'configure oslo_messaging_notifications default params' do
@ -53,7 +53,7 @@ describe 'oslo::messaging::notifications' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'notifications examples'
it_behaves_like 'oslo-messaging-notifications'
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::messaging::rabbit' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-messaging-rabbit' do
context 'with default parameters' do
it 'configure oslo_messaging_rabbit default params' do
@ -199,19 +199,15 @@ describe 'oslo::messaging::rabbit' do
end
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
include_examples 'shared examples'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_behaves_like 'oslo-messaging-rabbit'
end
include_examples 'shared examples'
end
end

@ -4,7 +4,7 @@ describe 'oslo::policy' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-policy' do
context 'with default parameters' do
it 'configure oslo_policy default params' do
@ -51,7 +51,7 @@ describe 'oslo::policy' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'shared examples'
it_behaves_like 'oslo-policy'
end
end
end

@ -4,7 +4,7 @@ describe 'oslo::versionedobjects' do
let (:title) { 'keystone_config' }
shared_examples 'shared examples' do
shared_examples 'oslo-versionedobjects' do
context 'with default parameters' do
it 'configure oslo_versionedobjects default params' do
@ -25,19 +25,16 @@ describe 'oslo::versionedobjects' do
end
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
include_examples 'shared examples'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_behaves_like 'oslo-versionedobjects'
end
include_examples 'shared examples'
end
end

Loading…
Cancel
Save