Files
puppet-openstack/spec/classes/openstack_keystone_spec.rb
Dan Bode 1fe95ffb06 Add swift to keystone class
This commit adds keystone auth objects to the
openstack::keystone class. This allows users to
easily add a swift services auth user to their
existing keystone servers. It is not enabled by
default.
2013-03-01 17:30:32 -08:00

62 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'openstack::keystone' do
# minimum set of default parameters
let :default_params do
{
:db_host => '127.0.0.1',
:db_password => 'pass',
:admin_token => 'token',
:admin_email => 'email@address.com',
:admin_password => 'pass',
:glance_user_password => 'pass',
:nova_user_password => 'pass',
:cinder_user_password => 'pass',
:quantum_user_password => 'pass',
:swift_user_password => false,
:public_address => '127.0.0.1',
}
end
let :facts do
{
:operatingsystem => 'Ubuntu',
:osfamily => 'Debian',
}
end
let :params do
default_params
end
describe 'without swift' do
it { should_not contain_class('swift::keystone::auth') }
end
describe 'swift' do
describe 'without password' do
let :params do
default_params.merge(:swift => true)
end
it 'should fail when the password is not set' do
expect do
subject
end.to raise_error(Puppet::Error)
end
end
describe 'with password' do
let :params do
default_params.merge(:swift => true, :swift_user_password => 'dude')
end
it do
should contain_class('swift::keystone::auth').with(
:password => 'dude',
:address => '127.0.0.1',
:region => 'RegionOne'
)
end
end
end
end