do not create nova volumes endpoints
Since the openstack module no longer supports nova volumes, this commit sets the cinder flag of the nova::keystone::auth class which ensures that nova-volume endpoints will not be configured. This commit also refactors the unit tests a bit to use required_params instead of default_params. Change-Id: I32392bd4ffe2548a02f08fec8467eda2df4bd7c0
This commit is contained in:
		@@ -1,32 +1,72 @@
 | 
			
		||||
require 'spec_helper'
 | 
			
		||||
 | 
			
		||||
describe 'openstack::keystone' do
 | 
			
		||||
  # minimum set of default parameters
 | 
			
		||||
  let :default_params do
 | 
			
		||||
 | 
			
		||||
  # set the parameters that absolutely must be set for the class to even compile
 | 
			
		||||
  let :required_params do
 | 
			
		||||
    {
 | 
			
		||||
      :db_host                => '127.0.0.1',
 | 
			
		||||
      :db_password            => 'pass',
 | 
			
		||||
      :admin_token            => 'token',
 | 
			
		||||
      :admin_email            => 'email@address.com',
 | 
			
		||||
      :db_password            => 'pass',
 | 
			
		||||
      :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',
 | 
			
		||||
      :db_host                => '127.0.0.1',
 | 
			
		||||
      :admin_email            => 'root@localhost'
 | 
			
		||||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # set the class parameters to only be those that are required
 | 
			
		||||
  let :params do
 | 
			
		||||
    required_params
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  let :facts do
 | 
			
		||||
    {
 | 
			
		||||
      :operatingsystem => 'Ubuntu',
 | 
			
		||||
      :osfamily        => 'Debian',
 | 
			
		||||
    }
 | 
			
		||||
    { :osfamily => 'Debian', :operatingsystem => 'Ubuntu' }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  let :params do
 | 
			
		||||
    default_params
 | 
			
		||||
  describe 'with only required params (and defaults for everything else)' do
 | 
			
		||||
 | 
			
		||||
    it 'should configure keystone and all default endpoints' do
 | 
			
		||||
      should contain_class('keystone').with(
 | 
			
		||||
        :verbose        => 'False',
 | 
			
		||||
        :debug          => 'False',
 | 
			
		||||
        :bind_host      => '0.0.0.0',
 | 
			
		||||
        :catalog_type   => 'sql',
 | 
			
		||||
        :admin_token    => 'token',
 | 
			
		||||
        :enabled        => true,
 | 
			
		||||
        :sql_connection => 'mysql://keystone:pass@127.0.0.1/keystone'
 | 
			
		||||
      )
 | 
			
		||||
      [ 'glance', 'cinder', 'quantum' ].each do |type|
 | 
			
		||||
        should contain_class("#{type}::keystone::auth").with(
 | 
			
		||||
          :password         => params["#{type}_user_password".intern],
 | 
			
		||||
          :public_address   => params[:public_address],
 | 
			
		||||
          :admin_address    => params[:public_address],
 | 
			
		||||
          :internal_address => params[:public_address],
 | 
			
		||||
          :region           => 'RegionOne'
 | 
			
		||||
        )
 | 
			
		||||
      end
 | 
			
		||||
      should contain_class('nova::keystone::auth').with(
 | 
			
		||||
        :password         => params[:nova_user_password],
 | 
			
		||||
        :public_address   => params[:public_address],
 | 
			
		||||
        :admin_address    => params[:public_address],
 | 
			
		||||
        :internal_address => params[:public_address],
 | 
			
		||||
        :region           => 'RegionOne',
 | 
			
		||||
        :cinder           => true
 | 
			
		||||
      )
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  describe 'without nova' do
 | 
			
		||||
 | 
			
		||||
    let :params do
 | 
			
		||||
      required_params.merge(:nova => false)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it { should_not contain_class('nova::keystone::auth') }
 | 
			
		||||
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  describe 'without swift' do
 | 
			
		||||
@@ -36,7 +76,7 @@ describe 'openstack::keystone' do
 | 
			
		||||
  describe 'swift' do
 | 
			
		||||
    describe 'without password' do
 | 
			
		||||
      let :params do
 | 
			
		||||
        default_params.merge(:swift => true)
 | 
			
		||||
        required_params.merge(:swift => true)
 | 
			
		||||
      end
 | 
			
		||||
      it 'should fail when the password is not set' do
 | 
			
		||||
        expect do
 | 
			
		||||
@@ -46,7 +86,7 @@ describe 'openstack::keystone' do
 | 
			
		||||
    end
 | 
			
		||||
    describe 'with password' do
 | 
			
		||||
      let :params do
 | 
			
		||||
        default_params.merge(:swift => true, :swift_user_password => 'dude')
 | 
			
		||||
        required_params.merge(:swift => true, :swift_user_password => 'dude')
 | 
			
		||||
      end
 | 
			
		||||
      it do
 | 
			
		||||
        should contain_class('swift::keystone::auth').with(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user