2012-04-22 12:11:27 -07:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::proxy::cache' do
|
|
|
|
|
|
|
|
let :facts do
|
|
|
|
{
|
|
|
|
:operatingsystem => 'Ubuntu',
|
|
|
|
:osfamily => 'Debian',
|
2014-08-12 16:59:04 +02:00
|
|
|
:processorcount => 1
|
2012-04-22 12:11:27 -07:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
let :pre_condition do
|
2013-10-29 22:56:31 -04:00
|
|
|
'class { "concat::setup": }
|
|
|
|
concat { "/etc/swift/proxy-server.conf": }
|
2012-04-22 12:11:27 -07:00
|
|
|
class { "memcached": max_memory => 1 }'
|
|
|
|
end
|
|
|
|
|
|
|
|
let :fragment_file do
|
|
|
|
"/var/lib/puppet/concat/_etc_swift_proxy-server.conf/fragments/23_swift_cache"
|
|
|
|
end
|
|
|
|
|
2015-03-23 18:23:07 +01:00
|
|
|
it { is_expected.to contain_file(fragment_file).with_content(/[filter:cache]/) }
|
|
|
|
it { is_expected.to contain_file(fragment_file).with_content(/use = egg:swift#memcache/) }
|
2012-04-22 12:11:27 -07:00
|
|
|
|
|
|
|
describe 'with defaults' do
|
|
|
|
|
2015-03-23 18:23:07 +01:00
|
|
|
it { is_expected.to contain_file(fragment_file).with_content(/memcache_servers = 127\.0\.0\.1:11211/) }
|
2012-04-22 12:11:27 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with overridden memcache server' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{:memcache_servers => '10.0.0.1:1'}
|
|
|
|
end
|
|
|
|
|
2015-03-23 18:23:07 +01:00
|
|
|
it { is_expected.to contain_file(fragment_file).with_content(/memcache_servers = 10\.0\.0\.1:1/) }
|
2012-04-22 12:11:27 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'with overridden memcache server array' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{:memcache_servers => ['10.0.0.1:1', '10.0.0.2:2']}
|
|
|
|
end
|
|
|
|
|
2015-03-23 18:23:07 +01:00
|
|
|
it { is_expected.to contain_file(fragment_file).with_content(/memcache_servers = 10\.0\.0\.1:1,10\.0\.0\.2:2/) }
|
2012-04-22 12:11:27 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|