@ -119,89 +119,44 @@ describe 'aodh::api' do
it_raises 'a Puppet::Error' , / Invalid service_name /
end
end
context 'on Debian platforms' do
let :facts do
@default_facts . merge ( {
:osfamily = > 'Debian' ,
:operatingsystem = > 'Debian' ,
:operatingsystemrelease = > '8.0' ,
:concat_basedir = > '/var/lib/puppet/concat' ,
:fqdn = > 'some.host.tld' ,
:processorcount = > 2 ,
} )
end
let :platform_params do
{ :api_package_name = > 'aodh-api' ,
:api_service_name = > 'aodh-api' }
end
it_configures 'aodh-api'
end
context 'on RedHat platforms' do
let :facts do
@default_facts . merge ( {
:osfamily = > 'RedHat' ,
:operatingsystem = > 'RedHat' ,
:operatingsystemrelease = > '7.1' ,
:fqdn = > 'some.host.tld' ,
:concat_basedir = > '/var/lib/puppet/concat' ,
:processorcount = > 2 ,
} )
end
let :platform_params do
{ :api_package_name = > 'openstack-aodh-api' ,
:api_service_name = > 'openstack-aodh-api' }
end
it_configures 'aodh-api'
end
describe 'with custom auth_uri' do
let :facts do
@default_facts . merge ( { :osfamily = > 'RedHat' } )
end
before do
params . merge! ( {
:keystone_auth_uri = > 'https://foo.bar:1234/' ,
} )
end
it 'should configure custom auth_uri correctly' do
is_expected . to contain_aodh_config ( 'keystone_authtoken/auth_uri' ) . with_value ( 'https://foo.bar:1234/' )
context " with custom keystone identity_uri and auth_uri " do
before do
params . merge! ( {
:keystone_identity_uri = > 'https://foo.bar:35357/' ,
:keystone_auth_uri = > 'https://foo.bar:5000/v2.0/' ,
} )
end
it 'configures identity_uri and auth_uri but deprecates old auth settings' do
is_expected . to contain_aodh_config ( 'keystone_authtoken/identity_uri' ) . with_value ( " https://foo.bar:35357/ " ) ;
is_expected . to contain_aodh_config ( 'keystone_authtoken/auth_uri' ) . with_value ( " https://foo.bar:5000/v2.0/ " ) ;
end
end
end
describe " with custom keystone identity_uri " do
let :facts do
@default_facts . merge ( { :osfamily = > 'RedHat' } )
end
before do
params . merge! ( {
:keystone_identity_uri = > 'https://foo.bar:1234/' ,
} )
end
it 'configures identity_uri' do
is_expected . to contain_aodh_config ( 'keystone_authtoken/identity_uri' ) . with_value ( " https://foo.bar:1234/ " ) ;
end
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 ( {
:fqdn = > 'some.host.tld' ,
:processorcount = > 2 ,
:concat_basedir = > '/var/lib/puppet/concat'
} ) )
end
describe " with custom keystone identity_uri and auth_uri " do
let :facts do
@default_facts . merge ( { :osfamily = > 'RedHat' } )
end
before do
params . merge! ( {
:keystone_identity_uri = > 'https://foo.bar:35357/' ,
:keystone_auth_uri = > 'https://foo.bar:5000/v2.0/' ,
} )
end
it 'configures identity_uri and auth_uri but deprecates old auth settings' do
is_expected . to contain_aodh_config ( 'keystone_authtoken/identity_uri' ) . with_value ( " https://foo.bar:35357/ " ) ;
is_expected . to contain_aodh_config ( 'keystone_authtoken/auth_uri' ) . with_value ( " https://foo.bar:5000/v2.0/ " ) ;
let ( :platform_params ) do
case facts [ :osfamily ]
when 'Debian'
{ :api_package_name = > 'aodh-api' ,
:api_service_name = > 'aodh-api' }
when 'RedHat'
{ :api_package_name = > 'openstack-aodh-api' ,
:api_service_name = > 'openstack-aodh-api' }
end
end
it_configures 'aodh-api'
end
end