2012-02-26 20:51:17 -08:00
|
|
|
require 'spec_helper'
|
|
|
|
describe 'swift::ringbuilder::rebalance' do
|
|
|
|
describe 'with allowed titles' do
|
|
|
|
['object', 'container', 'account'].each do |type|
|
|
|
|
describe "when title is #{type}" do
|
|
|
|
let :title do
|
|
|
|
type
|
|
|
|
end
|
|
|
|
it { should contain_exec("rebalance_#{type}").with(
|
|
|
|
{:command => "swift-ring-builder /etc/swift/#{type}.builder rebalance",
|
2012-05-08 15:52:19 -07:00
|
|
|
:path => '/usr/bin',
|
2012-02-26 20:51:17 -08:00
|
|
|
:refreshonly => true}
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
describe 'with an invalid title' do
|
|
|
|
let :title do
|
|
|
|
'invalid'
|
|
|
|
end
|
|
|
|
it 'should raise an error' do
|
2012-07-12 15:24:03 -07:00
|
|
|
expect { subject }.to raise_error(Puppet::Error)
|
2012-02-26 20:51:17 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|