
I had previously checked in some broken tests that resulted from the updating the concat fragments names to ensure uniqueness between services (eg, choosing fragment names like HEADER were causing duplicate resource errors, these have been prefixed with the service name glance-api to ensure uniqueness) This commit updates the tests so that they work for this previous commit (oops!)
61 lines
1.7 KiB
Ruby
61 lines
1.7 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'glance::backend::swift' do
|
|
let :facts do
|
|
{
|
|
:osfamily => 'Debian'
|
|
}
|
|
end
|
|
let :params do
|
|
{
|
|
'swift_store_user' => 'glance',
|
|
'swift_store_key' => 'glance_key'
|
|
}
|
|
end
|
|
it 'should set the default store to file' do
|
|
verify_contents(
|
|
subject,
|
|
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/04_glance-api-backend',
|
|
['default_store = swift']
|
|
)
|
|
end
|
|
it 'should configure swift settings with defaults' do
|
|
verify_contents(
|
|
subject,
|
|
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-swift',
|
|
[
|
|
'swift_store_auth_address = 127.0.0.1:8080/v1.0/',
|
|
'swift_store_user = glance',
|
|
'swift_store_key = glance_key',
|
|
'swift_store_container = glance',
|
|
'swift_store_create_container_on_put = False'
|
|
]
|
|
)
|
|
end
|
|
describe 'when datadir is overridden' do
|
|
let :params do
|
|
{
|
|
'swift_store_user' => 'glance',
|
|
'swift_store_key' => 'glance_key',
|
|
'swift_store_container' => 'glance2',
|
|
'swift_store_auth_address' => '127.0.0.1:8080/v2.0/',
|
|
'swift_store_create_container_on_put' => 'True'
|
|
}
|
|
end
|
|
|
|
it 'should configure file backend settings with specified parameter' do
|
|
verify_contents(
|
|
subject,
|
|
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-swift',
|
|
[
|
|
'swift_store_auth_address = 127.0.0.1:8080/v2.0/',
|
|
'swift_store_user = glance',
|
|
'swift_store_key = glance_key',
|
|
'swift_store_container = glance2',
|
|
'swift_store_create_container_on_put = True'
|
|
]
|
|
)
|
|
end
|
|
end
|
|
end
|