spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax in order to be prepared for rspec 3.x move. In details: * Use shared_examples "a Puppet::Error" for puppet::error tests * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * Fix spec tests for rspec-puppet 2.0.0 * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) * Remove un-used puppet-lint (name_containing_dash config) Change-Id: I1b82e4f6ec0b1bbf52e86c5d127413a26277ae8c Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
This commit is contained in:
parent
e68dc141cc
commit
d7e9fe0e7a
10
Gemfile
10
Gemfile
@ -2,11 +2,11 @@ source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'puppet-lint', '~> 1.1'
|
||||
gem 'rspec-puppet', '~> 1.0.1'
|
||||
gem 'puppet-lint-param-docs', '1.1.0'
|
||||
gem 'rake', '10.1.1'
|
||||
gem 'rspec', '< 2.99'
|
||||
gem 'rspec-puppet', '~> 2.0.0', :require => false
|
||||
|
||||
gem 'metadata-json-lint'
|
||||
gem 'puppet-lint-param-docs'
|
||||
|
||||
gem 'json'
|
||||
gem 'webmock'
|
||||
end
|
||||
|
1
Rakefile
1
Rakefile
@ -2,6 +2,5 @@ require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_names_containing_dash')
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
|
@ -14,13 +14,13 @@ describe 'heat::api_cfn' do
|
||||
|
||||
context 'config params' do
|
||||
|
||||
it { should contain_class('heat') }
|
||||
it { should contain_class('heat::params') }
|
||||
it { should contain_class('heat::policy') }
|
||||
it { is_expected.to contain_class('heat') }
|
||||
it { is_expected.to contain_class('heat::params') }
|
||||
it { is_expected.to contain_class('heat::policy') }
|
||||
|
||||
it { should contain_heat_config('heat_api_cfn/bind_host').with_value( params[:bind_host] ) }
|
||||
it { should contain_heat_config('heat_api_cfn/bind_port').with_value( params[:bind_port] ) }
|
||||
it { should contain_heat_config('heat_api_cfn/workers').with_value( params[:workers] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/bind_host').with_value( params[:bind_host] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/bind_port').with_value( params[:bind_port] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/workers').with_value( params[:workers] ) }
|
||||
|
||||
end
|
||||
|
||||
@ -33,8 +33,8 @@ describe 'heat::api_cfn' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api_cfn/cert_file').with_value('/path/to/cert') }
|
||||
it { should contain_heat_config('heat_api_cfn/key_file').with_value('/path/to/key') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/cert_file').with_value('/path/to/cert') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/key_file').with_value('/path/to/key') }
|
||||
end
|
||||
|
||||
context 'with SSL socket options set with wrong parameters' do
|
||||
@ -57,8 +57,8 @@ describe 'heat::api_cfn' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api_cfn/cert_file').with_ensure('absent') }
|
||||
it { should contain_heat_config('heat_api_cfn/key_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/cert_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cfn/key_file').with_ensure('absent') }
|
||||
end
|
||||
|
||||
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||
@ -69,14 +69,14 @@ describe 'heat::api_cfn' do
|
||||
|
||||
it 'configures heat-api-cfn service' do
|
||||
|
||||
should contain_service('heat-api-cfn').with(
|
||||
is_expected.to contain_service('heat-api-cfn').with(
|
||||
:ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped',
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => params[:enabled],
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
:hasrestart => true
|
||||
)
|
||||
is_expected.to contain_service('heat-api-cfn').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -90,14 +90,14 @@ describe 'heat::api_cfn' do
|
||||
|
||||
it 'configures heat-api-cfn service' do
|
||||
|
||||
should contain_service('heat-api-cfn').with(
|
||||
is_expected.to contain_service('heat-api-cfn').with(
|
||||
:ensure => nil,
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => false,
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
:hasrestart => true
|
||||
)
|
||||
is_expected.to contain_service('heat-api-cfn').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,13 +14,13 @@ describe 'heat::api_cloudwatch' do
|
||||
|
||||
context 'config params' do
|
||||
|
||||
it { should contain_class('heat') }
|
||||
it { should contain_class('heat::params') }
|
||||
it { should contain_class('heat::policy') }
|
||||
it { is_expected.to contain_class('heat') }
|
||||
it { is_expected.to contain_class('heat::params') }
|
||||
it { is_expected.to contain_class('heat::policy') }
|
||||
|
||||
it { should contain_heat_config('heat_api_cloudwatch/bind_host').with_value( params[:bind_host] ) }
|
||||
it { should contain_heat_config('heat_api_cloudwatch/bind_port').with_value( params[:bind_port] ) }
|
||||
it { should contain_heat_config('heat_api_cloudwatch/workers').with_value( params[:workers] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/bind_host').with_value( params[:bind_host] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/bind_port').with_value( params[:bind_port] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/workers').with_value( params[:workers] ) }
|
||||
|
||||
end
|
||||
|
||||
@ -33,8 +33,8 @@ describe 'heat::api_cloudwatch' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api_cloudwatch/cert_file').with_value('/path/to/cert') }
|
||||
it { should contain_heat_config('heat_api_cloudwatch/key_file').with_value('/path/to/key') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/cert_file').with_value('/path/to/cert') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/key_file').with_value('/path/to/key') }
|
||||
end
|
||||
|
||||
context 'with SSL socket options set with wrong parameters' do
|
||||
@ -57,8 +57,8 @@ describe 'heat::api_cloudwatch' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api_cloudwatch/cert_file').with_ensure('absent') }
|
||||
it { should contain_heat_config('heat_api_cloudwatch/key_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/cert_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api_cloudwatch/key_file').with_ensure('absent') }
|
||||
end
|
||||
|
||||
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||
@ -69,14 +69,14 @@ describe 'heat::api_cloudwatch' do
|
||||
|
||||
it 'configures heat-api-cloudwatch service' do
|
||||
|
||||
should contain_service('heat-api-cloudwatch').with(
|
||||
is_expected.to contain_service('heat-api-cloudwatch').with(
|
||||
:ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped',
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => params[:enabled],
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
:hasrestart => true
|
||||
)
|
||||
is_expected.to contain_service('heat-api-cloudwatch').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -90,14 +90,14 @@ describe 'heat::api_cloudwatch' do
|
||||
|
||||
it 'configures heat-api-cloudwatch service' do
|
||||
|
||||
should contain_service('heat-api-cloudwatch').with(
|
||||
is_expected.to contain_service('heat-api-cloudwatch').with(
|
||||
:ensure => nil,
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => false,
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
:hasrestart => true
|
||||
)
|
||||
is_expected.to contain_service('heat-api-cloudwatch').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,13 +14,13 @@ describe 'heat::api' do
|
||||
|
||||
context 'config params' do
|
||||
|
||||
it { should contain_class('heat') }
|
||||
it { should contain_class('heat::params') }
|
||||
it { should contain_class('heat::policy') }
|
||||
it { is_expected.to contain_class('heat') }
|
||||
it { is_expected.to contain_class('heat::params') }
|
||||
it { is_expected.to contain_class('heat::policy') }
|
||||
|
||||
it { should contain_heat_config('heat_api/bind_host').with_value( params[:bind_host] ) }
|
||||
it { should contain_heat_config('heat_api/bind_port').with_value( params[:bind_port] ) }
|
||||
it { should contain_heat_config('heat_api/workers').with_value( params[:workers] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api/bind_host').with_value( params[:bind_host] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api/bind_port').with_value( params[:bind_port] ) }
|
||||
it { is_expected.to contain_heat_config('heat_api/workers').with_value( params[:workers] ) }
|
||||
|
||||
end
|
||||
|
||||
@ -33,8 +33,8 @@ describe 'heat::api' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api/cert_file').with_value('/path/to/cert') }
|
||||
it { should contain_heat_config('heat_api/key_file').with_value('/path/to/key') }
|
||||
it { is_expected.to contain_heat_config('heat_api/cert_file').with_value('/path/to/cert') }
|
||||
it { is_expected.to contain_heat_config('heat_api/key_file').with_value('/path/to/key') }
|
||||
end
|
||||
|
||||
context 'with SSL socket options set with wrong parameters' do
|
||||
@ -57,8 +57,8 @@ describe 'heat::api' do
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_heat_config('heat_api/cert_file').with_ensure('absent') }
|
||||
it { should contain_heat_config('heat_api/key_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api/cert_file').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('heat_api/key_file').with_ensure('absent') }
|
||||
end
|
||||
|
||||
|
||||
@ -70,15 +70,15 @@ describe 'heat::api' do
|
||||
|
||||
it 'configures heat-api service' do
|
||||
|
||||
should contain_service('heat-api').with(
|
||||
is_expected.to contain_service('heat-api').with(
|
||||
:ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped',
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => params[:enabled],
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:require => ['Package[heat-common]', 'Package[heat-api]'],
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
:require => ['Package[heat-common]', 'Package[heat-api]']
|
||||
)
|
||||
is_expected.to contain_service('heat-api').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -92,15 +92,15 @@ describe 'heat::api' do
|
||||
|
||||
it 'configures heat-api service' do
|
||||
|
||||
should contain_service('heat-api').with(
|
||||
is_expected.to contain_service('heat-api').with(
|
||||
:ensure => nil,
|
||||
:name => platform_params[:api_service_name],
|
||||
:enable => false,
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:require => ['Package[heat-common]', 'Package[heat-api]'],
|
||||
:subscribe => ['Exec[heat-dbsync]']
|
||||
)
|
||||
is_expected.to contain_service('heat-api').that_subscribes_to('Exec[heat-dbsync]')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -18,11 +18,11 @@ describe 'heat::db::mysql' do
|
||||
|
||||
context 'when omiting the required parameter password' do
|
||||
before { params.delete(:password) }
|
||||
it { expect { should raise_error(Puppet::Error) } }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
|
||||
it 'creates a mysql database' do
|
||||
should contain_openstacklib__db__mysql( params[:dbname] ).with(
|
||||
is_expected.to contain_openstacklib__db__mysql( params[:dbname] ).with(
|
||||
:user => params[:user],
|
||||
:password_hash => '*58C036CDA51D8E8BBBBF2F9EA5ABF111ADA444F0',
|
||||
:host => params[:host],
|
||||
|
@ -24,7 +24,7 @@ describe 'heat::db::postgresql' do
|
||||
req_params
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('heat').with(
|
||||
it { is_expected.to contain_postgresql__server__db('heat').with(
|
||||
:user => 'heat',
|
||||
:password => 'md5fd5c4fca491370aab732f903e2fb7c99'
|
||||
)}
|
||||
@ -47,7 +47,7 @@ describe 'heat::db::postgresql' do
|
||||
req_params
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('heat').with(
|
||||
it { is_expected.to contain_postgresql__server__db('heat').with(
|
||||
:user => 'heat',
|
||||
:password => 'md5fd5c4fca491370aab732f903e2fb7c99'
|
||||
)}
|
||||
|
@ -42,9 +42,9 @@ describe 'heat::engine' do
|
||||
default_params.merge(params)
|
||||
end
|
||||
|
||||
it { should contain_package('heat-engine').with_name(os_params[:package_name]) }
|
||||
it { is_expected.to contain_package('heat-engine').with_name(os_params[:package_name]) }
|
||||
|
||||
it { should contain_service('heat-engine').with(
|
||||
it { is_expected.to contain_service('heat-engine').with(
|
||||
:ensure => (expected_params[:manage_service] && expected_params[:enabled]) ? 'running' : 'stopped',
|
||||
:name => os_params[:service_name],
|
||||
:enable => expected_params[:enabled],
|
||||
@ -56,20 +56,20 @@ describe 'heat::engine' do
|
||||
:subscribe => 'Exec[heat-dbsync]'
|
||||
) }
|
||||
|
||||
it { should contain_heat_config('DEFAULT/auth_encryption_key').with_value( expected_params[:auth_encryption_key] ) }
|
||||
it { should contain_heat_config('DEFAULT/heat_stack_user_role').with_value( expected_params[:heat_stack_user_role] ) }
|
||||
it { should contain_heat_config('DEFAULT/heat_metadata_server_url').with_value( expected_params[:heat_metadata_server_url] ) }
|
||||
it { should contain_heat_config('DEFAULT/heat_waitcondition_server_url').with_value( expected_params[:heat_waitcondition_server_url] ) }
|
||||
it { should contain_heat_config('DEFAULT/heat_watch_server_url').with_value( expected_params[:heat_watch_server_url] ) }
|
||||
it { should contain_heat_config('DEFAULT/engine_life_check_timeout').with_value( expected_params[:engine_life_check_timeout] ) }
|
||||
it { should contain_heat_config('DEFAULT/trusts_delegated_roles').with_value( expected_params[:trusts_delegated_roles] ) }
|
||||
it { should contain_heat_config('DEFAULT/deferred_auth_method').with_value( expected_params[:deferred_auth_method] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/auth_encryption_key').with_value( expected_params[:auth_encryption_key] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/heat_stack_user_role').with_value( expected_params[:heat_stack_user_role] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/heat_metadata_server_url').with_value( expected_params[:heat_metadata_server_url] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/heat_waitcondition_server_url').with_value( expected_params[:heat_waitcondition_server_url] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/heat_watch_server_url').with_value( expected_params[:heat_watch_server_url] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/engine_life_check_timeout').with_value( expected_params[:engine_life_check_timeout] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/trusts_delegated_roles').with_value( expected_params[:trusts_delegated_roles] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/deferred_auth_method').with_value( expected_params[:deferred_auth_method] ) }
|
||||
|
||||
it 'configures delegated roles' do
|
||||
should contain_keystone_role("role1").with(
|
||||
is_expected.to contain_keystone_role("role1").with(
|
||||
:ensure => 'present'
|
||||
)
|
||||
should contain_keystone_role("role2").with(
|
||||
is_expected.to contain_keystone_role("role2").with(
|
||||
:ensure => 'present'
|
||||
)
|
||||
end
|
||||
@ -82,7 +82,7 @@ describe 'heat::engine' do
|
||||
:enabled => false })
|
||||
end
|
||||
|
||||
it { should contain_service('heat-engine').with(
|
||||
it { is_expected.to contain_service('heat-engine').with(
|
||||
:ensure => nil,
|
||||
:name => os_params[:service_name],
|
||||
:enable => false,
|
||||
|
@ -75,17 +75,17 @@ describe 'heat' do
|
||||
|
||||
shared_examples_for 'a heat base installation' do
|
||||
|
||||
it { should contain_class('heat::params') }
|
||||
it { is_expected.to contain_class('heat::params') }
|
||||
|
||||
it 'configures heat group' do
|
||||
should contain_group('heat').with(
|
||||
is_expected.to contain_group('heat').with(
|
||||
:name => 'heat',
|
||||
:require => 'Package[heat-common]'
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures heat user' do
|
||||
should contain_user('heat').with(
|
||||
is_expected.to contain_user('heat').with(
|
||||
:name => 'heat',
|
||||
:gid => 'heat',
|
||||
:groups => ['heat'],
|
||||
@ -95,7 +95,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it 'configures heat configuration folder' do
|
||||
should contain_file('/etc/heat/').with(
|
||||
is_expected.to contain_file('/etc/heat/').with(
|
||||
:ensure => 'directory',
|
||||
:owner => 'heat',
|
||||
:group => 'heat',
|
||||
@ -105,7 +105,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it 'configures heat configuration file' do
|
||||
should contain_file('/etc/heat/heat.conf').with(
|
||||
is_expected.to contain_file('/etc/heat/heat.conf').with(
|
||||
:owner => 'heat',
|
||||
:group => 'heat',
|
||||
:mode => '0640',
|
||||
@ -114,7 +114,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it 'installs heat common package' do
|
||||
should contain_package('heat-common').with(
|
||||
is_expected.to contain_package('heat-common').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:common_package_name]
|
||||
)
|
||||
@ -122,47 +122,47 @@ describe 'heat' do
|
||||
|
||||
|
||||
it 'configures debug and verbose' do
|
||||
should contain_heat_config('DEFAULT/debug').with_value( params[:debug] )
|
||||
should contain_heat_config('DEFAULT/verbose').with_value( params[:verbose] )
|
||||
is_expected.to contain_heat_config('DEFAULT/debug').with_value( params[:debug] )
|
||||
is_expected.to contain_heat_config('DEFAULT/verbose').with_value( params[:verbose] )
|
||||
end
|
||||
|
||||
it 'configures auth_uri' do
|
||||
should contain_heat_config('keystone_authtoken/auth_uri').with_value( params[:auth_uri] )
|
||||
is_expected.to contain_heat_config('keystone_authtoken/auth_uri').with_value( params[:auth_uri] )
|
||||
end
|
||||
|
||||
it 'configures logging directory by default' do
|
||||
should contain_heat_config('DEFAULT/log_dir').with_value( params[:log_dir] )
|
||||
is_expected.to contain_heat_config('DEFAULT/log_dir').with_value( params[:log_dir] )
|
||||
end
|
||||
|
||||
context 'with logging directory disabled' do
|
||||
before { params.merge!( :log_dir => false) }
|
||||
|
||||
it { should contain_heat_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/log_dir').with_ensure('absent') }
|
||||
end
|
||||
|
||||
it 'configures database_connection' do
|
||||
should contain_heat_config('database/connection').with_value( params[:database_connection] )
|
||||
is_expected.to contain_heat_config('database/connection').with_value( params[:database_connection] )
|
||||
end
|
||||
|
||||
it 'configures database_idle_timeout' do
|
||||
should contain_heat_config('database/idle_timeout').with_value( params[:database_idle_timeout] )
|
||||
is_expected.to contain_heat_config('database/idle_timeout').with_value( params[:database_idle_timeout] )
|
||||
end
|
||||
|
||||
context("failing if database_connection is invalid") do
|
||||
before { params[:database_connection] = 'foo://foo:bar@baz/moo' }
|
||||
it { expect { should raise_error(Puppet::Error) } }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
|
||||
context("with deprecated sql_connection parameter") do
|
||||
before { params[:sql_connection] = 'mysql://a:b@c/d' }
|
||||
it { should contain_heat_config('database/connection').with_value( params[:sql_connection] )}
|
||||
it { is_expected.to contain_heat_config('database/connection').with_value( params[:sql_connection] )}
|
||||
end
|
||||
|
||||
it 'configures keystone_ec2_uri' do
|
||||
should contain_heat_config('ec2authtoken/auth_uri').with_value( params[:keystone_ec2_uri] )
|
||||
is_expected.to contain_heat_config('ec2authtoken/auth_uri').with_value( params[:keystone_ec2_uri] )
|
||||
end
|
||||
|
||||
it { should contain_heat_config('paste_deploy/flavor').with_value('keystone') }
|
||||
it { is_expected.to contain_heat_config('paste_deploy/flavor').with_value('keystone') }
|
||||
|
||||
it 'keeps keystone secrets secret' do
|
||||
should contain_heat_config('keystone_authtoken/admin_password').with_secret(true)
|
||||
@ -173,88 +173,88 @@ describe 'heat' do
|
||||
|
||||
shared_examples_for 'rabbit without HA support (with backward compatibility)' do
|
||||
it 'configures rabbit' do
|
||||
should contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
should contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
it { should contain_heat_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] ) }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] ) }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
it { should contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
end
|
||||
|
||||
shared_examples_for 'rabbit without HA support (without backward compatibility)' do
|
||||
it 'configures rabbit' do
|
||||
should contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
should contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
it { should contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
it { should contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
end
|
||||
|
||||
shared_examples_for 'rabbit with HA support' do
|
||||
it 'configures rabbit' do
|
||||
should contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
should contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
should contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
it { should contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
|
||||
it { should contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('true') }
|
||||
it { should contain_heat_config('DEFAULT/amqp_durable_queues').with_value(true) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('true') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(true) }
|
||||
end
|
||||
|
||||
|
||||
shared_examples_for 'qpid as rpc backend' do
|
||||
context("with default parameters") do
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect').with_value(true) }
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect_timeout').with_value('0') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect_limit').with_value('0') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect_interval_min').with_value('0') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect_interval_max').with_value('0') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_reconnect_interval').with_value('0') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_heartbeat').with_value('60') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_protocol').with_value('tcp') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_tcp_nodelay').with_value(true) }
|
||||
it { should contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect').with_value(true) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect_timeout').with_value('0') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect_limit').with_value('0') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect_interval_min').with_value('0') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect_interval_max').with_value('0') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_reconnect_interval').with_value('0') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_heartbeat').with_value('60') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_protocol').with_value('tcp') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_tcp_nodelay').with_value(true) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) }
|
||||
end
|
||||
|
||||
context("with mandatory parameters set") do
|
||||
it { should contain_heat_config('DEFAULT/rpc_backend').with_value('heat.openstack.common.rpc.impl_qpid') }
|
||||
it { should contain_heat_config('DEFAULT/qpid_hostname').with_value( params[:qpid_hostname] ) }
|
||||
it { should contain_heat_config('DEFAULT/qpid_port').with_value( params[:qpid_port] ) }
|
||||
it { should contain_heat_config('DEFAULT/qpid_username').with_value( params[:qpid_username]) }
|
||||
it { should contain_heat_config('DEFAULT/qpid_password').with_value(params[:qpid_password]) }
|
||||
it { should contain_heat_config('DEFAULT/qpid_password').with_secret( true ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/rpc_backend').with_value('heat.openstack.common.rpc.impl_qpid') }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_hostname').with_value( params[:qpid_hostname] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_port').with_value( params[:qpid_port] ) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_username').with_value( params[:qpid_username]) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_password').with_value(params[:qpid_password]) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/qpid_password').with_secret( true ) }
|
||||
end
|
||||
|
||||
context("failing if the rpc_backend is not present") do
|
||||
before { params.delete( :rpc_backend) }
|
||||
it { expect { should raise_error(Puppet::Error) } }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
end
|
||||
|
||||
@ -270,11 +270,11 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
end
|
||||
end
|
||||
|
||||
@ -286,11 +286,11 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1')
|
||||
end
|
||||
end
|
||||
|
||||
@ -303,11 +303,11 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('false')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
should contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('false')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
@ -339,7 +339,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
shared_examples_for 'with syslog disabled' do
|
||||
it { should contain_heat_config('DEFAULT/use_syslog').with_value(false) }
|
||||
it { is_expected.to contain_heat_config('DEFAULT/use_syslog').with_value(false) }
|
||||
end
|
||||
|
||||
shared_examples_for 'with syslog enabled' do
|
||||
@ -350,8 +350,8 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('DEFAULT/use_syslog').with_value(true)
|
||||
should contain_heat_config('DEFAULT/syslog_log_facility').with_value('LOG_USER')
|
||||
is_expected.to contain_heat_config('DEFAULT/use_syslog').with_value(true)
|
||||
is_expected.to contain_heat_config('DEFAULT/syslog_log_facility').with_value('LOG_USER')
|
||||
end
|
||||
end
|
||||
|
||||
@ -364,8 +364,8 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('DEFAULT/use_syslog').with_value(true)
|
||||
should contain_heat_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
|
||||
is_expected.to contain_heat_config('DEFAULT/use_syslog').with_value(true)
|
||||
is_expected.to contain_heat_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
|
||||
end
|
||||
end
|
||||
|
||||
@ -377,7 +377,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('database/idle_timeout').with_value(69)
|
||||
is_expected.to contain_heat_config('database/idle_timeout').with_value(69)
|
||||
end
|
||||
end
|
||||
|
||||
@ -389,7 +389,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('ec2authtoken/auth_uri').with_value('http://1.2.3.4:35357/v2.0/ec2tokens')
|
||||
is_expected.to contain_heat_config('ec2authtoken/auth_uri').with_value('http://1.2.3.4:35357/v2.0/ec2tokens')
|
||||
end
|
||||
end
|
||||
|
||||
@ -401,7 +401,7 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it do
|
||||
should contain_heat_config('keystone_authtoken/auth_uri').with_value('http://1.2.3.4:35357/v2.0')
|
||||
is_expected.to contain_heat_config('keystone_authtoken/auth_uri').with_value('http://1.2.3.4:35357/v2.0')
|
||||
end
|
||||
end
|
||||
|
||||
@ -413,13 +413,13 @@ describe 'heat' do
|
||||
end
|
||||
|
||||
it 'has region_name set when specified' do
|
||||
should contain_heat_config('DEFAULT/region_name_for_services').with_value('East')
|
||||
is_expected.to contain_heat_config('DEFAULT/region_name_for_services').with_value('East')
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'without region_name set' do
|
||||
it 'doesnt have region_name set by default' do
|
||||
should contain_heat_config('DEFAULT/region_name_for_services').with_enure('absent')
|
||||
is_expected.to contain_heat_config('DEFAULT/region_name_for_services').with_enure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -26,11 +26,11 @@ describe 'heat::keystone::auth_cfn' do
|
||||
|
||||
context 'without the required password parameter' do
|
||||
before { params.delete(:password) }
|
||||
it { expect { should raise_error(Puppet::Error) } }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
|
||||
it 'configures heat user' do
|
||||
should contain_keystone_user( params[:auth_name] ).with(
|
||||
is_expected.to contain_keystone_user( params[:auth_name] ).with(
|
||||
:ensure => 'present',
|
||||
:password => params[:password],
|
||||
:email => params[:email],
|
||||
@ -39,14 +39,14 @@ describe 'heat::keystone::auth_cfn' do
|
||||
end
|
||||
|
||||
it 'configures heat user roles' do
|
||||
should contain_keystone_user_role("#{params[:auth_name]}@#{params[:tenant]}").with(
|
||||
is_expected.to contain_keystone_user_role("#{params[:auth_name]}@#{params[:tenant]}").with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures heat service' do
|
||||
should contain_keystone_service( params[:auth_name] ).with(
|
||||
is_expected.to contain_keystone_service( params[:auth_name] ).with(
|
||||
:ensure => 'present',
|
||||
:type => params[:service_type],
|
||||
:description => 'Openstack Cloudformation Service'
|
||||
@ -54,7 +54,7 @@ describe 'heat::keystone::auth_cfn' do
|
||||
end
|
||||
|
||||
it 'configure heat endpoints' do
|
||||
should contain_keystone_endpoint("#{params[:region]}/#{params[:auth_name]}").with(
|
||||
is_expected.to contain_keystone_endpoint("#{params[:region]}/#{params[:auth_name]}").with(
|
||||
:ensure => 'present',
|
||||
:public_url => "#{params[:public_protocol]}://#{params[:public_address]}:#{params[:port]}/#{params[:version]}/",
|
||||
:admin_url => "#{params[:admin_protocol]}://#{params[:admin_address]}:#{params[:port]}/#{params[:version]}/",
|
||||
@ -86,16 +86,16 @@ describe 'heat::keystone::auth_cfn' do
|
||||
})
|
||||
end
|
||||
it 'configures correct user name' do
|
||||
should contain_keystone_user('heat-cfn')
|
||||
is_expected.to contain_keystone_user('heat-cfn')
|
||||
end
|
||||
it 'configures correct user role' do
|
||||
should contain_keystone_user_role('heat-cfn@services')
|
||||
is_expected.to contain_keystone_user_role('heat-cfn@services')
|
||||
end
|
||||
it 'configures correct service name' do
|
||||
should contain_keystone_service('heat-cfn_service')
|
||||
is_expected.to contain_keystone_service('heat-cfn_service')
|
||||
end
|
||||
it 'configures correct endpoint name' do
|
||||
should contain_keystone_endpoint('RegionOne/heat-cfn_service')
|
||||
is_expected.to contain_keystone_endpoint('RegionOne/heat-cfn_service')
|
||||
end
|
||||
end
|
||||
|
||||
@ -104,10 +104,10 @@ describe 'heat::keystone::auth_cfn' do
|
||||
params.merge!( :configure_user => false )
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('heat_cfn') }
|
||||
it { should contain_keystone_user_role('heat-cfn@services') }
|
||||
it { is_expected.to_not contain_keystone_user('heat_cfn') }
|
||||
it { is_expected.to contain_keystone_user_role('heat-cfn@services') }
|
||||
|
||||
it { should contain_keystone_service('heat-cfn').with(
|
||||
it { is_expected.to contain_keystone_service('heat-cfn').with(
|
||||
:ensure => 'present',
|
||||
:type => 'cloudformation',
|
||||
:description => 'Openstack Cloudformation Service'
|
||||
@ -122,10 +122,10 @@ describe 'heat::keystone::auth_cfn' do
|
||||
)
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('heat_cfn') }
|
||||
it { should_not contain_keystone_user_role('heat-cfn@services') }
|
||||
it { is_expected.to_not contain_keystone_user('heat_cfn') }
|
||||
it { is_expected.to_not contain_keystone_user_role('heat-cfn@services') }
|
||||
|
||||
it { should contain_keystone_service('heat-cfn').with(
|
||||
it { is_expected.to contain_keystone_service('heat-cfn').with(
|
||||
:ensure => 'present',
|
||||
:type => 'cloudformation',
|
||||
:description => 'Openstack Cloudformation Service'
|
||||
|
@ -27,11 +27,11 @@ describe 'heat::keystone::auth' do
|
||||
|
||||
context 'without the required password parameter' do
|
||||
before { params.delete(:password) }
|
||||
it { expect { should raise_error(Puppet::Error) } }
|
||||
it { expect { is_expected.to raise_error(Puppet::Error) } }
|
||||
end
|
||||
|
||||
it 'configures heat user' do
|
||||
should contain_keystone_user( params[:auth_name] ).with(
|
||||
is_expected.to contain_keystone_user( params[:auth_name] ).with(
|
||||
:ensure => 'present',
|
||||
:password => params[:password],
|
||||
:email => params[:email],
|
||||
@ -40,21 +40,21 @@ describe 'heat::keystone::auth' do
|
||||
end
|
||||
|
||||
it 'configures heat user roles' do
|
||||
should contain_keystone_user_role("#{params[:auth_name]}@#{params[:tenant]}").with(
|
||||
is_expected.to contain_keystone_user_role("#{params[:auth_name]}@#{params[:tenant]}").with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures heat stack_user role' do
|
||||
should contain_keystone_role("heat_stack_user").with(
|
||||
is_expected.to contain_keystone_role("heat_stack_user").with(
|
||||
:ensure => 'present'
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
it 'configures heat service' do
|
||||
should contain_keystone_service( params[:auth_name] ).with(
|
||||
is_expected.to contain_keystone_service( params[:auth_name] ).with(
|
||||
:ensure => 'present',
|
||||
:type => params[:service_type],
|
||||
:description => 'Openstack Orchestration Service'
|
||||
@ -62,7 +62,7 @@ describe 'heat::keystone::auth' do
|
||||
end
|
||||
|
||||
it 'configure heat endpoints' do
|
||||
should contain_keystone_endpoint("#{params[:region]}/#{params[:auth_name]}").with(
|
||||
is_expected.to contain_keystone_endpoint("#{params[:region]}/#{params[:auth_name]}").with(
|
||||
:ensure => 'present',
|
||||
:public_url => "#{params[:public_protocol]}://#{params[:public_address]}:#{params[:port]}/#{params[:version]}/%(tenant_id)s",
|
||||
:admin_url => "#{params[:admin_protocol]}://#{params[:admin_address]}:#{params[:port]}/#{params[:version]}/%(tenant_id)s",
|
||||
@ -95,16 +95,16 @@ describe 'heat::keystone::auth' do
|
||||
})
|
||||
end
|
||||
it 'configures correct user name' do
|
||||
should contain_keystone_user('heat')
|
||||
is_expected.to contain_keystone_user('heat')
|
||||
end
|
||||
it 'configures correct user role' do
|
||||
should contain_keystone_user_role('heat@services')
|
||||
is_expected.to contain_keystone_user_role('heat@services')
|
||||
end
|
||||
it 'configures correct service name' do
|
||||
should contain_keystone_service('heat_service')
|
||||
is_expected.to contain_keystone_service('heat_service')
|
||||
end
|
||||
it 'configures correct endpoint name' do
|
||||
should contain_keystone_endpoint('RegionOne/heat_service')
|
||||
is_expected.to contain_keystone_endpoint('RegionOne/heat_service')
|
||||
end
|
||||
end
|
||||
|
||||
@ -113,10 +113,10 @@ describe 'heat::keystone::auth' do
|
||||
params.merge!( :configure_user => false )
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('heat') }
|
||||
it { should contain_keystone_user_role('heat@services') }
|
||||
it { is_expected.to_not contain_keystone_user('heat') }
|
||||
it { is_expected.to contain_keystone_user_role('heat@services') }
|
||||
|
||||
it { should contain_keystone_service('heat').with(
|
||||
it { is_expected.to contain_keystone_service('heat').with(
|
||||
:ensure => 'present',
|
||||
:type => 'orchestration',
|
||||
:description => 'Openstack Orchestration Service'
|
||||
@ -131,10 +131,10 @@ describe 'heat::keystone::auth' do
|
||||
)
|
||||
end
|
||||
|
||||
it { should_not contain_keystone_user('heat') }
|
||||
it { should_not contain_keystone_user_role('heat@services') }
|
||||
it { is_expected.to_not contain_keystone_user('heat') }
|
||||
it { is_expected.to_not contain_keystone_user_role('heat@services') }
|
||||
|
||||
it { should contain_keystone_service('heat').with(
|
||||
it { is_expected.to contain_keystone_service('heat').with(
|
||||
:ensure => 'present',
|
||||
:type => 'orchestration',
|
||||
:description => 'Openstack Orchestration Service'
|
||||
@ -160,7 +160,7 @@ describe 'heat::keystone::auth' do
|
||||
})
|
||||
end
|
||||
it 'configures delegated roles' do
|
||||
should contain_keystone_role("heat_stack_owner").with(
|
||||
is_expected.to contain_keystone_role("heat_stack_owner").with(
|
||||
:ensure => 'present'
|
||||
)
|
||||
end
|
||||
@ -184,10 +184,7 @@ describe 'heat::keystone::auth' do
|
||||
:password => 'something',
|
||||
}
|
||||
end
|
||||
it 'should fail with deprecated and new params both set' do
|
||||
expect {
|
||||
should compile
|
||||
}.to raise_error Puppet::Error, /both heat::engine and heat::keystone::auth are both trying to configure delegated roles/
|
||||
end
|
||||
it_raises 'a Puppet::Error', /both heat::engine and heat::keystone::auth are both trying to configure delegated roles/
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -21,7 +21,7 @@ describe 'heat::keystone::domain' do
|
||||
end
|
||||
|
||||
it 'should configure heat domain id' do
|
||||
should contain_heat_domain_id_setter('heat_domain_id').with(
|
||||
is_expected.to contain_heat_domain_id_setter('heat_domain_id').with(
|
||||
:ensure => 'present',
|
||||
:domain_name => params[:domain_name],
|
||||
:auth_url => params[:auth_url],
|
||||
@ -32,7 +32,7 @@ describe 'heat::keystone::domain' do
|
||||
end
|
||||
|
||||
it 'should exec helper script' do
|
||||
should contain_exec('heat_domain_create').with(
|
||||
is_expected.to contain_exec('heat_domain_create').with(
|
||||
:command => 'heat-keystone-setup-domain &>/dev/null',
|
||||
:path => '/usr/bin',
|
||||
:require => 'Package[heat-common]',
|
||||
|
@ -42,36 +42,36 @@ describe 'heat::logging' do
|
||||
|
||||
shared_examples_for 'logging params set' do
|
||||
it 'enables logging params' do
|
||||
should contain_heat_config('DEFAULT/logging_context_format_string').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/logging_context_format_string').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s')
|
||||
|
||||
should contain_heat_config('DEFAULT/logging_default_format_string').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/logging_default_format_string').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s')
|
||||
|
||||
should contain_heat_config('DEFAULT/logging_debug_format_suffix').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/logging_debug_format_suffix').with_value(
|
||||
'%(funcName)s %(pathname)s:%(lineno)d')
|
||||
|
||||
should contain_heat_config('DEFAULT/logging_exception_prefix').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/logging_exception_prefix').with_value(
|
||||
'%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s')
|
||||
|
||||
should contain_heat_config('DEFAULT/log_config_append').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/log_config_append').with_value(
|
||||
'/etc/heat/logging.conf')
|
||||
should contain_heat_config('DEFAULT/publish_errors').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/publish_errors').with_value(
|
||||
true)
|
||||
|
||||
should contain_heat_config('DEFAULT/default_log_levels').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/default_log_levels').with_value(
|
||||
'amqp=WARN,amqplib=WARN,boto=WARN,iso8601=WARN,qpid=WARN,requests.packages.urllib3.connectionpool=WARN,sqlalchemy=WARN,suds=INFO')
|
||||
|
||||
should contain_heat_config('DEFAULT/fatal_deprecations').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/fatal_deprecations').with_value(
|
||||
true)
|
||||
|
||||
should contain_heat_config('DEFAULT/instance_format').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/instance_format').with_value(
|
||||
'[instance: %(uuid)s] ')
|
||||
|
||||
should contain_heat_config('DEFAULT/instance_uuid_format').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/instance_uuid_format').with_value(
|
||||
'[instance: %(uuid)s] ')
|
||||
|
||||
should contain_heat_config('DEFAULT/log_date_format').with_value(
|
||||
is_expected.to contain_heat_config('DEFAULT/log_date_format').with_value(
|
||||
'%Y-%m-%d %H:%M:%S')
|
||||
end
|
||||
end
|
||||
@ -84,7 +84,7 @@ describe 'heat::logging' do
|
||||
:default_log_levels, :fatal_deprecations,
|
||||
:instance_format, :instance_uuid_format,
|
||||
:log_date_format, ].each { |param|
|
||||
it { should contain_heat_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
it { is_expected.to contain_heat_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -16,7 +16,7 @@ describe 'heat::policy' do
|
||||
end
|
||||
|
||||
it 'set up the policies' do
|
||||
should contain_openstacklib__policy__base('context_is_admin').with({
|
||||
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
|
||||
:key => 'context_is_admin',
|
||||
:value => 'foo:bar'
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
shared_examples_for "a Puppet::Error" do |description|
|
||||
it "with message matching #{description.inspect}" do
|
||||
expect { should have_class_count(1) }.to raise_error(Puppet::Error, description)
|
||||
expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
|
||||
end
|
||||
end
|
||||
|
@ -75,7 +75,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should create a resource' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect(provider.create).to be_nil
|
||||
end
|
||||
end
|
||||
@ -99,7 +99,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should receive an api error' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect { provider.create }.to raise_error KeystoneAPIError, /Unable to find matching domain/
|
||||
end
|
||||
end
|
||||
@ -124,7 +124,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should receive an api error' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect { provider.create }.to raise_error KeystoneAPIError, /Found multiple matches for domain name/
|
||||
end
|
||||
end
|
||||
@ -141,7 +141,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should receive an authentication error' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect { provider.create }.to raise_error KeystoneAPIError
|
||||
end
|
||||
end
|
||||
@ -155,7 +155,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should receive a connection error' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect { provider.create }.to raise_error KeystoneConnectionError
|
||||
end
|
||||
end
|
||||
@ -169,7 +169,7 @@ describe 'Puppet::Type.type(:heat_keystone_domain_id_setter)' do
|
||||
it 'should receive a connection error' do
|
||||
resource = Puppet::Type::Heat_domain_id_setter.new(params)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.exists?).to be_false
|
||||
expect(provider.exists?).to be_falsey
|
||||
expect { provider.create }.to raise_error KeystoneConnectionError
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user