puppet-glance/spec/classes/glance_backend_rbd_spec.rb
Maksym Yatsenko 323162d6c9 Add rados_connect_timeout parameter in glance config
It adds rados_connect_timeout parameter with default value
to glance config, which tells how much time glance-api has
to wait before close the connection.

Setting 'rados_connect_timeout' <= 0  means no timeout.

A CR that adds "rados_connect_timeout": #200554
change-id: Ib44f74063d5a8332c6b5f3e15bcfa044c86bef9b

Change-Id: I2352bdec2a3339785eb38249afe385c5e496457c
2015-09-01 08:19:40 +03:00

76 lines
2.2 KiB
Ruby

require 'spec_helper'
describe 'glance::backend::rbd' do
let :facts do
{
: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 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',
}
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_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'latest'
)
}
end
describe 'package on RedHat platform el6' do
let :facts do
{
: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
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0'
}
end
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-rbd',
:ensure => 'present'
)
}
end
end