
This patch aim to update our specs test in order to work with the rspec-puppet release 2.0.0, in the mean time, we update rspec syntax order to be prepared for rspec 3.x move. In details: * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0 * Use shared_examples "a Puppet::Error" for puppet::error tests * * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) * * Fix spec tests for rspec-puppet 2.0.0 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper) Change-Id: Ida94605916fe26dd4c5fb328f79c4e787d29dcf5 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
179 lines
4.5 KiB
Ruby
179 lines
4.5 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'neutron::keystone::auth' do
|
|
|
|
describe 'with default class parameters' do
|
|
let :params do
|
|
{
|
|
:password => 'neutron_password',
|
|
:tenant => 'foobar'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('neutron').with(
|
|
:ensure => 'present',
|
|
:password => 'neutron_password',
|
|
:tenant => 'foobar'
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_user_role('neutron@foobar').with(
|
|
:ensure => 'present',
|
|
:roles => 'admin'
|
|
)}
|
|
|
|
it { is_expected.to contain_keystone_service('neutron').with(
|
|
:ensure => 'present',
|
|
:type => 'network',
|
|
:description => 'Neutron Networking Service'
|
|
) }
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with(
|
|
: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
|
|
|
|
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 { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with_notify('Service[neutron-server]') }
|
|
end
|
|
|
|
describe 'when overriding public_protocol, public_port and public address' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'neutron_password',
|
|
:public_protocol => 'https',
|
|
:public_port => '80',
|
|
:public_address => '10.10.10.10',
|
|
:port => '81',
|
|
:internal_address => '10.10.10.11',
|
|
:admin_address => '10.10.10.12'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron').with(
|
|
: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
|
|
|
|
describe 'when overriding admin_protocol and internal_protocol' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'neutron_password',
|
|
:admin_protocol => 'https',
|
|
:internal_protocol => 'https',
|
|
}
|
|
end
|
|
|
|
it { is_expected.to 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
|
|
|
|
describe 'when overriding auth name' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'foo',
|
|
:auth_name => 'neutrony'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('neutrony') }
|
|
|
|
it { is_expected.to contain_keystone_user_role('neutrony@services') }
|
|
|
|
it { is_expected.to contain_keystone_service('neutrony') }
|
|
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/neutrony') }
|
|
|
|
end
|
|
|
|
describe 'when overriding service name' do
|
|
|
|
let :params do
|
|
{
|
|
:service_name => 'neutron_service',
|
|
:password => 'neutron_password'
|
|
}
|
|
end
|
|
|
|
it { is_expected.to contain_keystone_user('neutron') }
|
|
it { is_expected.to contain_keystone_user_role('neutron@services') }
|
|
it { is_expected.to contain_keystone_service('neutron_service') }
|
|
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron_service') }
|
|
|
|
end
|
|
|
|
describe 'when disabling user configuration' do
|
|
|
|
let :params do
|
|
{
|
|
:password => 'neutron_password',
|
|
:configure_user => false
|
|
}
|
|
end
|
|
|
|
it { is_expected.not_to contain_keystone_user('neutron') }
|
|
|
|
it { is_expected.to contain_keystone_user_role('neutron@services') }
|
|
|
|
it { is_expected.to 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 { is_expected.not_to contain_keystone_user('neutron') }
|
|
|
|
it { is_expected.not_to contain_keystone_user_role('neutron@services') }
|
|
|
|
it { is_expected.to contain_keystone_service('neutron').with(
|
|
:ensure => 'present',
|
|
:type => 'network',
|
|
:description => 'Neutron Networking Service'
|
|
) }
|
|
|
|
end
|
|
|
|
end
|