Moves all spec tests over to using rspec-puppet-facts and runs the tests for all our supported operating systems. Change-Id: Ie2d60acac835affaf46a5276c9755640a723bca4
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
require 'spec_helper'
 | 
						|
 | 
						|
describe 'swift::proxy::keystone' do
 | 
						|
  shared_examples 'swift::proxy::keystone' do
 | 
						|
    it { is_expected.to contain_swift_proxy_config('filter:keystone/use').with_value('egg:swift#keystoneauth') }
 | 
						|
 | 
						|
    describe 'with defaults' do
 | 
						|
      it { is_expected.to contain_swift_proxy_config('filter:keystone/operator_roles').with_value('admin, SwiftOperator') }
 | 
						|
      it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_prefix').with_value('AUTH_') }
 | 
						|
    end
 | 
						|
 | 
						|
    describe 'with parameter overrides' do
 | 
						|
      let :params do
 | 
						|
        {
 | 
						|
          :operator_roles      => 'foo',
 | 
						|
          :reseller_prefix     => 'SWIFT_',
 | 
						|
          :reseller_admin_role => 'ResellerAdmin'
 | 
						|
        }
 | 
						|
 | 
						|
        it { is_expected.to contain_swift_proxy_config('filter:keystone/operator_roles').with_value('foo') }
 | 
						|
        it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_prefix').with_value('SWIFT_') }
 | 
						|
        it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_admin_role').with_value('ResellerAdmin') }
 | 
						|
      end
 | 
						|
    end
 | 
						|
  end
 | 
						|
 | 
						|
  on_supported_os({
 | 
						|
    :supported_os => OSDefaults.get_supported_os
 | 
						|
  }).each do |os,facts|
 | 
						|
    context "on #{os}" do
 | 
						|
      let (:facts) do
 | 
						|
        facts.merge(OSDefaults.get_facts())
 | 
						|
      end
 | 
						|
 | 
						|
      it_configures 'swift::proxy::keystone'
 | 
						|
    end
 | 
						|
  end
 | 
						|
end
 |