2012-01-19 18:58:37 -08:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::storage' do
|
2012-03-13 16:30:19 -07:00
|
|
|
let :facts do
|
2016-07-07 12:01:08 +02:00
|
|
|
OSDefaults.get_facts({
|
2012-03-20 09:30:58 -07:00
|
|
|
:operatingsystem => 'Ubuntu',
|
2016-07-07 12:01:08 +02:00
|
|
|
:osfamily => 'Debian',
|
|
|
|
})
|
2012-03-13 16:30:19 -07:00
|
|
|
end
|
|
|
|
|
2012-03-02 20:01:49 -08:00
|
|
|
describe 'when required classes are specified' do
|
|
|
|
let :pre_condition do
|
2016-06-02 01:13:09 -03:00
|
|
|
"class { 'swift': swift_hash_path_suffix => 'changeme' }"
|
2012-03-02 20:01:49 -08:00
|
|
|
end
|
2012-01-19 18:58:37 -08:00
|
|
|
|
2012-03-02 20:01:49 -08:00
|
|
|
describe 'when the local net ip is specified' do
|
2012-01-19 18:58:37 -08:00
|
|
|
let :params do
|
2012-03-02 20:01:49 -08:00
|
|
|
{
|
|
|
|
:storage_local_net_ip => '127.0.0.1',
|
|
|
|
}
|
2012-01-19 18:58:37 -08:00
|
|
|
end
|
|
|
|
|
2015-03-23 18:23:07 +01:00
|
|
|
it { is_expected.to contain_class('rsync::server').with(
|
2012-03-13 16:30:19 -07:00
|
|
|
{:use_xinetd => true,
|
2012-06-19 16:16:24 +02:00
|
|
|
:address => params[:storage_local_net_ip],
|
|
|
|
:use_chroot => 'no'
|
2012-02-26 20:51:17 -08:00
|
|
|
}
|
|
|
|
)}
|
2012-03-02 20:01:49 -08:00
|
|
|
end
|
|
|
|
describe 'when local net ip is not specified' do
|
2015-11-26 10:02:30 +01:00
|
|
|
if Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0
|
|
|
|
it_raises 'a Puppet::Error', /expects a value for parameter 'storage_local_net_ip'/
|
|
|
|
else
|
|
|
|
it_raises 'a Puppet::Error', /Must pass storage_local_net_ip/
|
|
|
|
end
|
2012-03-02 20:01:49 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
describe 'when the dependencies are not specified' do
|
|
|
|
it 'should fail' do
|
2015-03-23 18:23:07 +01:00
|
|
|
expect { catalogue }.to raise_error(Puppet::Error)
|
2012-01-19 18:58:37 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|