2012-05-29 13:06:21 -07:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'swift::keystone::auth' do
|
|
|
|
|
|
|
|
describe 'with default class parameters' do
|
|
|
|
|
|
|
|
it { should contain_keystone_user('swift').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:password => 'swift_password'
|
|
|
|
) }
|
|
|
|
|
|
|
|
it { should contain_keystone_user_role('swift@services').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:roles => 'admin',
|
|
|
|
:require => 'Keystone_user[swift]'
|
|
|
|
)}
|
|
|
|
|
|
|
|
it { should contain_keystone_service('swift').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:type => 'object-store',
|
|
|
|
:description => 'Openstack Object-Store Service'
|
|
|
|
) }
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
2012-05-29 13:06:21 -07:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s",
|
2013-04-18 12:12:51 +08:00
|
|
|
:admin_url => "http://127.0.0.1:8080/",
|
2012-05-29 13:06:21 -07:00
|
|
|
:internal_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s"
|
|
|
|
) }
|
|
|
|
|
|
|
|
it { should contain_keystone_service('swift_s3').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:type => 's3',
|
|
|
|
:description => 'Openstack S3 Service'
|
|
|
|
) }
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
2012-05-29 13:06:21 -07:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => 'http://127.0.0.1:8080',
|
|
|
|
:admin_url => 'http://127.0.0.1:8080',
|
|
|
|
:internal_url => 'http://127.0.0.1:8080'
|
|
|
|
) }
|
|
|
|
end
|
|
|
|
|
2013-04-18 12:12:51 +08:00
|
|
|
describe 'when overriding public_port, public address, admin_address and internal_address' do
|
2012-12-20 11:58:10 +01:00
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
2013-04-18 12:12:51 +08:00
|
|
|
:public_port => '80',
|
|
|
|
:public_address => '10.10.10.10',
|
|
|
|
:admin_address => '10.10.10.2',
|
|
|
|
:internal_address => '127.0.0.1'
|
2012-12-20 11:58:10 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
|
|
|
:ensure => 'present',
|
2013-01-21 10:30:18 +01:00
|
|
|
:public_url => "http://10.10.10.10:80/v1/AUTH_%(tenant_id)s",
|
2013-04-18 12:12:51 +08:00
|
|
|
:admin_url => "http://10.10.10.2:8080/",
|
2012-12-20 11:58:10 +01:00
|
|
|
:internal_url => "http://127.0.0.1:8080/v1/AUTH_%(tenant_id)s"
|
|
|
|
) }
|
|
|
|
|
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
|
|
|
:ensure => 'present',
|
2013-01-21 10:30:18 +01:00
|
|
|
:public_url => 'http://10.10.10.10:80',
|
2013-04-18 12:12:51 +08:00
|
|
|
:admin_url => 'http://10.10.10.2:8080',
|
2012-12-20 11:58:10 +01:00
|
|
|
:internal_url => 'http://127.0.0.1:8080'
|
|
|
|
) }
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2012-05-29 13:06:21 -07:00
|
|
|
describe 'when overriding password' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'foo'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_user('swift').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:password => 'foo'
|
2013-02-22 16:47:26 +01:00
|
|
|
) }
|
2012-05-29 13:06:21 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when overriding auth name' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:auth_name => 'swifty'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_user('swifty') }
|
|
|
|
|
|
|
|
it { should contain_keystone_user_role('swifty@services') }
|
|
|
|
|
|
|
|
it { should contain_keystone_service('swifty') }
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swifty') }
|
2012-05-29 13:06:21 -07:00
|
|
|
|
|
|
|
it { should contain_keystone_service('swifty_s3') }
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swifty_s3') }
|
2012-05-29 13:06:21 -07:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when overriding address' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:address => '192.168.0.1',
|
|
|
|
:port => '8081'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift').with(
|
2012-05-29 13:06:21 -07:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s",
|
2013-04-18 12:12:51 +08:00
|
|
|
:admin_url => "http://192.168.0.1:8081/",
|
2012-05-29 13:06:21 -07:00
|
|
|
:internal_url => "http://192.168.0.1:8081/v1/AUTH_%(tenant_id)s"
|
|
|
|
) }
|
|
|
|
|
2012-11-15 11:46:05 +00:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/swift_s3').with(
|
2012-05-29 13:06:21 -07:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => 'http://192.168.0.1:8081',
|
|
|
|
:admin_url => 'http://192.168.0.1:8081',
|
|
|
|
:internal_url => 'http://192.168.0.1:8081'
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|