
ceilometermiddleware does not require access to local resources owned by the ceilometer group but communicate with ceilometer over rpc. Thus we don't need to add the swift user to the ceilometer group. Change-Id: I3666c5b3d45ba99a5716cfbe5174202b53ad4950
81 lines
2.2 KiB
Ruby
81 lines
2.2 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'swift' do
|
|
shared_examples 'swift' do
|
|
let :params do
|
|
{
|
|
:swift_hash_path_suffix => 'string',
|
|
:max_header_size => '16384',
|
|
}
|
|
end
|
|
|
|
describe 'when no swift hash is specified' do
|
|
let :params do
|
|
{}
|
|
end
|
|
|
|
it 'should raise an exception' do
|
|
expect { catalogue }.to raise_error(Puppet::Error)
|
|
end
|
|
end
|
|
|
|
describe 'when using the default value for package_ensure' do
|
|
let :file_defaults do
|
|
{
|
|
:owner => 'swift',
|
|
:group => 'swift',
|
|
:tag => 'swift-file',
|
|
}
|
|
end
|
|
|
|
it 'configures swift.conf' do
|
|
is_expected.to contain_swift_config(
|
|
'swift-hash/swift_hash_path_suffix').with_value('string')
|
|
is_expected.to contain_swift_config(
|
|
'swift-constraints/max_header_size').with_value('16384')
|
|
end
|
|
|
|
it {
|
|
is_expected.to contain_package('swift').with_ensure('present')
|
|
is_expected.to contain_package('swift').that_requires('Anchor[swift::install::begin]')
|
|
is_expected.to contain_package('swift').that_notifies('Anchor[swift::install::end]')
|
|
}
|
|
end
|
|
|
|
describe 'when overriding package_ensure parameter' do
|
|
it 'should effect ensure state of swift package' do
|
|
params[:package_ensure] = '1.12.0-1'
|
|
is_expected.to contain_package('swift').with_ensure(params[:package_ensure])
|
|
end
|
|
end
|
|
|
|
describe 'when providing swift_hash_path_prefix and swift_hash_path_suffix' do
|
|
let (:params) do
|
|
{
|
|
:swift_hash_path_suffix => 'mysuffix',
|
|
:swift_hash_path_prefix => 'myprefix'
|
|
}
|
|
end
|
|
|
|
it 'should configure swift.conf' do
|
|
is_expected.to contain_swift_config(
|
|
'swift-hash/swift_hash_path_suffix').with_value('mysuffix')
|
|
is_expected.to contain_swift_config(
|
|
'swift-hash/swift_hash_path_prefix').with_value('myprefix')
|
|
end
|
|
end
|
|
end
|
|
|
|
on_supported_os({
|
|
:supported_os => OSDefaults.get_supported_os
|
|
}).each do |os,facts|
|
|
context "on #{os}" do
|
|
let (:facts) do
|
|
facts.merge(OSDefaults.get_facts())
|
|
end
|
|
|
|
it_configures 'swift'
|
|
end
|
|
end
|
|
end
|