Files
puppet-openstack/spec/classes/openstack_auth_file_spec.rb
Mathieu Gagné 782670bcea Add ability to configure endpoint_type in openrc
* Add the ability to configure the endpoint type used by the client
* Refactor to use a template for the generation of openrc

Change-Id: Id4b214373676488930be2066ad96ab3261ded909
2013-08-07 12:52:10 -04:00

64 lines
2.0 KiB
Ruby

require 'spec_helper'
describe 'openstack::auth_file' do
describe "when only passing default class parameters" do
let :params do
{ :admin_password => 'admin' }
end
it 'should create a openrc file' do
verify_contents(subject, '/root/openrc', [
'export OS_NO_CACHE=true',
'export OS_TENANT_NAME=admin',
'export OS_USERNAME=admin',
'export OS_PASSWORD=admin',
'export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/',
'export OS_AUTH_STRATEGY=keystone',
'export OS_REGION_NAME=RegionOne',
'export CINDER_ENDPOINT_TYPE=publicURL',
'export GLANCE_ENDPOINT_TYPE=publicURL',
'export KEYSTONE_ENDPOINT_TYPE=publicURL',
'export NOVA_ENDPOINT_TYPE=publicURL',
'export QUANTUM_ENDPOINT_TYPE=publicURL'
])
end
end
describe 'when overriding parameters' do
let :params do
{
:controller_node => '127.0.0.2',
:admin_password => 'admin',
:keystone_admin_token => 'keystone',
:cinder_endpoint_type => 'privateURL',
:glance_endpoint_type => 'privateURL',
:keystone_endpoint_type => 'privateURL',
:nova_endpoint_type => 'privateURL',
:quantum_endpoint_type => 'privateURL',
}
end
it 'should create a openrc file' do
verify_contents(subject, '/root/openrc', [
'export OS_SERVICE_TOKEN=keystone',
'export OS_SERVICE_ENDPOINT=http://127.0.0.2:35357/v2.0/',
'export OS_NO_CACHE=true',
'export OS_TENANT_NAME=admin',
'export OS_USERNAME=admin',
'export OS_PASSWORD=admin',
'export OS_AUTH_URL=http://127.0.0.2:5000/v2.0/',
'export OS_AUTH_STRATEGY=keystone',
'export OS_REGION_NAME=RegionOne',
'export CINDER_ENDPOINT_TYPE=privateURL',
'export GLANCE_ENDPOINT_TYPE=privateURL',
'export KEYSTONE_ENDPOINT_TYPE=privateURL',
'export NOVA_ENDPOINT_TYPE=privateURL',
'export QUANTUM_ENDPOINT_TYPE=privateURL'
])
end
end
end