puppet-neutron/spec/classes/quantum_keystone_auth_spec.rb
Mathieu Gagné 32a4e0c07d Add basic rspec tests to ensure catalog compiles
* Add basic rspec tests
* Add required fixtures: mysql, vswitch.
* Fix relationship between Package['dnsmasq'] and
  Package['quantum-dhcp-agent']. RedHat does not have such package and
  catalog compilation would fail on RedHat platforms.
* Restore Ruby 1.8 compatibility by removing trailing comma
  on the final element of hash.

Change-Id: I7cfc2f9b308116fe9c8b7f242f794792be0be678
2013-05-03 02:00:37 -04:00

80 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'quantum::keystone::auth' do
describe 'with default class parameters' do
let :params do
{
:password => 'quantum_password'
}
end
it { should contain_keystone_user('quantum').with(
:ensure => 'present',
:password => 'quantum_password'
) }
it { should contain_keystone_user_role('quantum@services').with(
:ensure => 'present',
:roles => 'admin'
)}
it { should contain_keystone_service('quantum').with(
:ensure => 'present',
:type => 'network',
:description => 'Quantum Networking Service'
) }
it { should contain_keystone_endpoint('RegionOne/quantum').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 overriding public_protocol, public_port and public address' do
let :params do
{
:password => 'quantum_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 { should contain_keystone_endpoint('RegionOne/quantum').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 auth name' do
let :params do
{
:password => 'foo',
:auth_name => 'quantumy'
}
end
it { should contain_keystone_user('quantumy') }
it { should contain_keystone_user_role('quantumy@services') }
it { should contain_keystone_service('quantumy') }
it { should contain_keystone_endpoint('RegionOne/quantumy') }
end
end