
This change implements storage policies as defined by swift: http://docs.openstack.org/developer/swift/overview_policies.html There are two primary areas of change in this review - Add storage policy support to the ringbuilder and ring devices, along with associated spec tests. - Adding storage policy support and enforcing rules in swift.conf using the swift_storage_policy type and provider. Also: updated spec tests and an update to swift acceptance test to use storage policies to configure an additional 3 replica based ring. See release notes and the README update for more details/instructions. Change-Id: I2b8db751790704df3f1027a14f61e231591537f3
69 lines
1.7 KiB
Ruby
69 lines
1.7 KiB
Ruby
require 'spec_helper'
|
|
describe 'swift::storage::node' do
|
|
|
|
let :facts do
|
|
OSDefaults.get_facts({
|
|
:operatingsystem => 'Ubuntu',
|
|
:osfamily => 'Debian',
|
|
:os_workers => 1,
|
|
})
|
|
end
|
|
|
|
|
|
describe 'with valid preconditons should contain ring devices' do
|
|
let :params do
|
|
{
|
|
:zone => "1",
|
|
:mnt_base_dir => '/srv/node'
|
|
}
|
|
end
|
|
|
|
let :title do
|
|
"1"
|
|
end
|
|
|
|
let :pre_condition do
|
|
"class { 'swift': swift_hash_path_suffix => 'foo' }
|
|
class { 'swift::storage': storage_local_net_ip => '127.0.0.1' }"
|
|
end
|
|
|
|
it { is_expected.to contain_ring_object_device("127.0.0.1:6010/1") }
|
|
it { is_expected.to contain_ring_container_device("127.0.0.1:6011/1") }
|
|
it { is_expected.to contain_ring_account_device("127.0.0.1:6012/1") }
|
|
|
|
end
|
|
|
|
context 'when zone is not a number' do
|
|
let(:title) { '1' }
|
|
let :params do
|
|
{ :zone => 'invalid',
|
|
:mnt_base_dir => '/srv/node' }
|
|
end
|
|
|
|
it_raises 'a Puppet::Error', /The zone parameter must be an integer/
|
|
end
|
|
|
|
describe 'with valid preconditons and policy_index=1 should contain ring devices' do
|
|
let :params do
|
|
{
|
|
:zone => "1",
|
|
:mnt_base_dir => '/srv/node',
|
|
:policy_index => '1',
|
|
}
|
|
end
|
|
|
|
let :title do
|
|
"1"
|
|
end
|
|
|
|
let :pre_condition do
|
|
"class { 'swift': swift_hash_path_suffix => 'foo' }
|
|
class { 'swift::storage': storage_local_net_ip => '127.0.0.1' }"
|
|
end
|
|
|
|
it { is_expected.to contain_ring_object_device("1:127.0.0.1:6010/1") }
|
|
it { is_expected.to contain_ring_container_device("127.0.0.1:6011/1") }
|
|
it { is_expected.to contain_ring_account_device("127.0.0.1:6012/1") }
|
|
end
|
|
end
|