2012-01-19 18:58:37 -08:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::storage' do
|
2012-02-26 20:51:17 -08:00
|
|
|
# TODO I am not testing the upstart code b/c it should be temporary
|
2012-01-19 18:58:37 -08:00
|
|
|
|
2012-03-13 16:30:19 -07:00
|
|
|
let :facts do
|
2012-03-20 09:30:58 -07:00
|
|
|
{
|
|
|
|
:operatingsystem => 'Ubuntu',
|
|
|
|
: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
|
2015-04-22 11:37:31 -07:00
|
|
|
"class { 'swift': swift_hash_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-03-23 18:23:07 +01:00
|
|
|
it_raises 'a Puppet::Error', /Must pass storage_local_net_ip/
|
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
|