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
23 lines
775 B
Ruby
23 lines
775 B
Ruby
|
|
require 'puppet'
|
|
describe Puppet::Type.type(:ring_container_device) do
|
|
it 'should fail if the name does not contain valid ipaddress' do
|
|
expect {
|
|
Puppet::Type.type(:ring_container_device).new(:name => '192.168.1.256:80/a')
|
|
}.to raise_error(Puppet::ResourceError, /invalid address/)
|
|
end
|
|
|
|
it 'should fail if the name does not contain a "/"' do
|
|
expect {
|
|
Puppet::Type.type(:ring_container_device).new(:name => 'foo:80')
|
|
}.to raise_error(Puppet::Error, /should contain a device/)
|
|
end
|
|
|
|
it 'should fail if the name contains a policy index' do
|
|
expect {
|
|
Puppet::Type.type(:ring_container_device).new(:name => '1:192.168.101.13:6002/1')
|
|
}.to raise_error(Puppet::Error, /Policy_index is not supported on container device/)
|
|
end
|
|
|
|
end
|