puppet-glance/spec/classes/glance_backend_rbd_spec.rb
Denis Egorenko ea0c4d5b51 Add posibility to configure Glance backend settings for Glare service
This patch adds posibility to configure backend settings for Glare
service.

Since Glare service is experimental feature, it can be usually disabled
for deployment. Hence was added a optional parameter 'glare_enabled' for
each backend manifest. So, if Glare is enabled glance glare config
will (and should) have same backend options as main glance api config.

Change-Id: I112a332f490d2e57eef5fa7d41d465c0eb89da04
Related-bug: #1555697
2016-03-28 16:18:13 +03:00

85 lines
3.2 KiB
Ruby

require 'spec_helper'
describe 'glance::backend::rbd' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
})
end
describe 'when defaults with rbd_store_user' do
let :params do
{
:rbd_store_user => 'glance',
}
end
it { is_expected.to contain_glance_api_config('glance_store/default_store').with_value('rbd') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_pool').with_value('images') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('8') }
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('0')}
it { is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('rbd') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_pool').with_value('images') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_ceph_conf').with_value('/etc/ceph/ceph.conf') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_chunk_size').with_value('8') }
it { is_expected.to_not contain_glance_glare_config('glance_store/rados_connect_timeout').with_value('0')}
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'present'
)
}
end
describe 'when passing params' do
let :params do
{
:rbd_store_user => 'user',
:rbd_store_chunk_size => '2',
:package_ensure => 'latest',
:rados_connect_timeout => '30',
:glare_enabled => true,
}
end
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_user').with_value('user') }
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('2') }
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('30')}
it { is_expected.to contain_glance_glare_config('glance_store/rbd_store_user').with_value('user') }
it { is_expected.to contain_glance_glare_config('glance_store/rbd_store_chunk_size').with_value('2') }
it { is_expected.to contain_glance_glare_config('glance_store/rados_connect_timeout').with_value('30')}
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'latest'
)
}
end
describe 'package on RedHat platform el6' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '6.5',
})
end
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'present'
)
}
end
describe 'package on RedHat platform el7' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0'
})
end
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-rbd',
:ensure => 'present'
)
}
end
end