puppet-glance/spec/classes/glance_backend_file_spec.rb
Emilien Macchi 57009efc4a file backend: do not inherit from glance::api
Do not make ::glance::backend::file inherits from ::glance::api because
::glance::api has parameters.
The class was broken until now.

Also, we need to include glance::backend::file to have
'filesystem_store_datadir' parameter in Glance config, since we're using
file backend.

If you don't provide this parameter, Glance fails to start:
glance_store._drivers.filesystem [-] Specify at least
'filesystem_store_datadir' or 'filesystem_store_datadirs' option

Change-Id: Iba6791199f7a2c7fef24b1e8752ed0b564b8512f
2015-10-02 17:15:18 -04:00

31 lines
984 B
Ruby

require 'spec_helper'
describe 'glance::backend::file' do
let :facts do
{ :osfamily => 'Debian' }
end
it 'configures glance-api.conf' do
is_expected.to contain_glance_api_config('glance_store/default_store').with_value('file')
is_expected.to contain_glance_api_config('glance_store/filesystem_store_datadir').with_value('/var/lib/glance/images/')
end
it 'configures glance-cache.conf' do
is_expected.to contain_glance_cache_config('glance_store/filesystem_store_datadir').with_value('/var/lib/glance/images/')
end
describe 'when overriding datadir' do
let :params do
{:filesystem_store_datadir => '/tmp/'}
end
it 'configures glance-api.conf' do
is_expected.to contain_glance_api_config('glance_store/filesystem_store_datadir').with_value('/tmp/')
end
it 'configures glance-cache.conf' do
is_expected.to contain_glance_cache_config('glance_store/filesystem_store_datadir').with_value('/tmp/')
end
end
end