2013-05-02 15:04:23 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
describe 'neutron::keystone::auth' do
|
2013-05-02 15:04:23 +02:00
|
|
|
|
|
|
|
describe 'with default class parameters' do
|
|
|
|
let :params do
|
|
|
|
{
|
2013-08-05 13:20:54 -04:00
|
|
|
:password => 'neutron_password',
|
2013-05-06 14:57:22 -06:00
|
|
|
:tenant => 'foobar'
|
2013-05-02 15:04:23 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_user('neutron').with(
|
2013-05-02 15:04:23 +02:00
|
|
|
:ensure => 'present',
|
2013-08-05 13:20:54 -04:00
|
|
|
:password => 'neutron_password',
|
2013-05-06 14:57:22 -06:00
|
|
|
:tenant => 'foobar'
|
2013-05-02 15:04:23 +02:00
|
|
|
) }
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_user_role('neutron@foobar').with(
|
2013-05-02 15:04:23 +02:00
|
|
|
:ensure => 'present',
|
2013-05-03 01:25:55 -04:00
|
|
|
:roles => 'admin'
|
2013-05-02 15:04:23 +02:00
|
|
|
)}
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_service('neutron').with(
|
2013-05-02 15:04:23 +02:00
|
|
|
:ensure => 'present',
|
|
|
|
:type => 'network',
|
2013-08-05 13:20:54 -04:00
|
|
|
:description => 'Neutron Networking Service'
|
2013-05-02 15:04:23 +02:00
|
|
|
) }
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutron').with(
|
2013-05-02 15:04:23 +02:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => "http://127.0.0.1:9696/",
|
|
|
|
:admin_url => "http://127.0.0.1:9696/",
|
|
|
|
:internal_url => "http://127.0.0.1:9696/"
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-10-30 15:10:41 +11:00
|
|
|
describe 'when configuring neutron-server' do
|
|
|
|
let :pre_condition do
|
|
|
|
"class { 'neutron::server': auth_password => 'test' }"
|
|
|
|
end
|
|
|
|
|
|
|
|
let :facts do
|
|
|
|
{ :osfamily => 'Debian' }
|
|
|
|
end
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'neutron_password',
|
|
|
|
:tenant => 'foobar'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutron').with_notify('Service[neutron-server]') }
|
|
|
|
end
|
|
|
|
|
2013-05-02 15:04:23 +02:00
|
|
|
describe 'when overriding public_protocol, public_port and public address' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
2013-08-05 13:20:54 -04:00
|
|
|
:password => 'neutron_password',
|
2013-05-06 14:57:22 -06:00
|
|
|
:public_protocol => 'https',
|
|
|
|
:public_port => '80',
|
|
|
|
:public_address => '10.10.10.10',
|
|
|
|
:port => '81',
|
2013-05-02 15:04:23 +02:00
|
|
|
:internal_address => '10.10.10.11',
|
2013-05-06 14:57:22 -06:00
|
|
|
:admin_address => '10.10.10.12'
|
2013-05-02 15:04:23 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutron').with(
|
2013-05-02 15:04:23 +02:00
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => "https://10.10.10.10:80/",
|
|
|
|
:internal_url => "http://10.10.10.11:81/",
|
|
|
|
:admin_url => "http://10.10.10.12:81/"
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2014-03-06 16:27:47 +01:00
|
|
|
describe 'when overriding admin_protocol and internal_protocol' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'neutron_password',
|
|
|
|
:admin_protocol => 'https',
|
|
|
|
:internal_protocol => 'https',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutron').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:public_url => "http://127.0.0.1:9696/",
|
|
|
|
:admin_url => "https://127.0.0.1:9696/",
|
|
|
|
:internal_url => "https://127.0.0.1:9696/"
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-05-02 15:04:23 +02:00
|
|
|
describe 'when overriding auth name' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'foo',
|
2013-08-05 13:20:54 -04:00
|
|
|
:auth_name => 'neutrony'
|
2013-05-02 15:04:23 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_user('neutrony') }
|
2013-05-02 15:04:23 +02:00
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_user_role('neutrony@services') }
|
2013-05-02 15:04:23 +02:00
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_service('neutrony') }
|
2013-05-02 15:04:23 +02:00
|
|
|
|
2013-08-05 13:20:54 -04:00
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutrony') }
|
2013-05-02 15:04:23 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2014-08-13 07:55:40 -06:00
|
|
|
describe 'when overriding service name' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:service_name => 'neutron_service',
|
|
|
|
:password => 'neutron_password'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_keystone_user('neutron') }
|
|
|
|
it { should contain_keystone_user_role('neutron@services') }
|
|
|
|
it { should contain_keystone_service('neutron_service') }
|
|
|
|
it { should contain_keystone_endpoint('RegionOne/neutron_service') }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2014-08-22 15:37:09 +03:00
|
|
|
describe 'when disabling user configuration' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'neutron_password',
|
|
|
|
:configure_user => false
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should_not contain_keystone_user('neutron') }
|
|
|
|
|
|
|
|
it { should contain_keystone_user_role('neutron@services') }
|
|
|
|
|
|
|
|
it { should contain_keystone_service('neutron').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:type => 'network',
|
|
|
|
:description => 'Neutron Networking Service'
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when disabling user and user role configuration' do
|
|
|
|
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:password => 'neutron_password',
|
|
|
|
:configure_user => false,
|
|
|
|
:configure_user_role => false
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should_not contain_keystone_user('neutron') }
|
|
|
|
|
|
|
|
it { should_not contain_keystone_user_role('neutron@services') }
|
|
|
|
|
|
|
|
it { should contain_keystone_service('neutron').with(
|
|
|
|
:ensure => 'present',
|
|
|
|
:type => 'network',
|
|
|
|
:description => 'Neutron Networking Service'
|
|
|
|
) }
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-05-02 15:04:23 +02:00
|
|
|
end
|