2013-07-05 08:19:29 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'glance::backend::rbd' do
|
|
|
|
let :facts do
|
2015-10-21 12:54:54 +03:00
|
|
|
@default_facts.merge({
|
|
|
|
:osfamily => 'Debian',
|
|
|
|
})
|
2013-07-05 08:19:29 +02:00
|
|
|
end
|
|
|
|
|
2016-03-31 12:20:23 +03:00
|
|
|
describe 'with default params' do
|
2013-07-05 08:19:29 +02:00
|
|
|
|
2015-02-25 05:37:44 +01:00
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/default_store').with_value('rbd') }
|
2016-03-31 12:20:23 +03:00
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_ceph_conf').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_chunk_size').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('<SERVICE DEFAULT>')}
|
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rbd_store_user').with_value('<SERVICE DEFAULT>')}
|
2013-07-05 08:19:29 +02:00
|
|
|
|
2016-03-25 21:03:49 +03:00
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/default_store').with_value('rbd') }
|
2016-03-31 12:20:23 +03:00
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_ceph_conf').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_chunk_size').with_value('<SERVICE DEFAULT>') }
|
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/rados_connect_timeout').with_value('<SERVICE DEFAULT>')}
|
|
|
|
it { is_expected.to_not contain_glance_glare_config('glance_store/rbd_store_user').with_value('<SERVICE DEFAULT>')}
|
2015-02-25 05:37:44 +01:00
|
|
|
it { is_expected.to contain_package('python-ceph').with(
|
2014-04-25 23:52:33 +02:00
|
|
|
:name => 'python-ceph',
|
|
|
|
:ensure => 'present'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
end
|
2013-07-05 08:19:29 +02:00
|
|
|
|
2013-09-05 16:50:56 +08:00
|
|
|
describe 'when passing params' do
|
|
|
|
let :params do
|
|
|
|
{
|
2014-03-25 12:36:45 -07:00
|
|
|
:rbd_store_user => 'user',
|
|
|
|
:rbd_store_chunk_size => '2',
|
2014-09-02 11:11:37 +12:00
|
|
|
:package_ensure => 'latest',
|
2015-08-31 14:00:54 +03:00
|
|
|
:rados_connect_timeout => '30',
|
2016-03-25 21:03:49 +03:00
|
|
|
:glare_enabled => true,
|
2013-09-05 16:50:56 +08:00
|
|
|
}
|
|
|
|
end
|
2015-03-26 14:48:46 +08:00
|
|
|
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') }
|
2015-08-31 14:00:54 +03:00
|
|
|
it { is_expected.to contain_glance_api_config('glance_store/rados_connect_timeout').with_value('30')}
|
2016-03-25 21:03:49 +03:00
|
|
|
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')}
|
2015-02-25 05:37:44 +01:00
|
|
|
it { is_expected.to contain_package('python-ceph').with(
|
2014-09-02 11:11:37 +12:00
|
|
|
:name => 'python-ceph',
|
|
|
|
:ensure => 'latest'
|
|
|
|
)
|
|
|
|
}
|
2013-09-05 16:50:56 +08:00
|
|
|
end
|
2015-06-03 18:53:09 -04:00
|
|
|
|
|
|
|
describe 'package on RedHat platform el6' do
|
|
|
|
let :facts do
|
2015-10-21 12:54:54 +03:00
|
|
|
@default_facts.merge({
|
2015-06-03 18:53:09 -04:00
|
|
|
:osfamily => 'RedHat',
|
|
|
|
:operatingsystemrelease => '6.5',
|
2015-10-21 12:54:54 +03:00
|
|
|
})
|
2015-06-03 18:53:09 -04:00
|
|
|
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
|
2015-10-21 12:54:54 +03:00
|
|
|
@default_facts.merge({
|
2015-06-03 18:53:09 -04:00
|
|
|
:osfamily => 'RedHat',
|
|
|
|
:operatingsystemrelease => '7.0'
|
2015-10-21 12:54:54 +03:00
|
|
|
})
|
2015-06-03 18:53:09 -04:00
|
|
|
end
|
|
|
|
it { is_expected.to contain_package('python-ceph').with(
|
|
|
|
:name => 'python-rbd',
|
|
|
|
:ensure => 'present'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
end
|
2013-07-05 08:19:29 +02:00
|
|
|
end
|