 3702dd1314
			
		
	
	3702dd1314
	
	
	
		
			
			Depends-On: https://review.opendev.org/#/c/751890/ Change-Id: Ia2973a8d37c3cef6255faf449d89121a60cecd10
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require 'spec_helper_acceptance'
 | |
| 
 | |
| describe 'openstacklib class' do
 | |
| 
 | |
|   context 'default parameters' do
 | |
| 
 | |
|     it 'should work with no errors' do
 | |
|       pp= <<-EOS
 | |
|       include openstack_integration
 | |
|       include openstack_integration::repos
 | |
|       include openstack_integration::rabbitmq
 | |
| 
 | |
|       # openstacklib resources
 | |
|       include openstacklib::openstackclient
 | |
| 
 | |
|       ::openstacklib::messaging::rabbitmq { 'ci':
 | |
|         userid   => 'ci',
 | |
|         is_admin => true,
 | |
|       }
 | |
|       EOS
 | |
| 
 | |
|       # Run it twice and test for idempotency
 | |
|       apply_manifest(pp, :catch_failures => true)
 | |
|       apply_manifest(pp, :catch_changes => true)
 | |
|     end
 | |
| 
 | |
|     describe 'test rabbitmq resources' do
 | |
|       it 'should list rabbitmq ci resources' do
 | |
|         command('rabbitmqctl list_users') do |r|
 | |
|           expect(r.stdout).to match(/^ci/)
 | |
|           expect(r.stdout).not_to match(/^guest/)
 | |
|           expect(r.exit_code).to eq(0)
 | |
|         end
 | |
| 
 | |
|         command('rabbitmqctl list_permissions') do |r|
 | |
|           expect(r.stdout).to match(/^ci\t\.\*\t\.\*\t\.\*$/)
 | |
|           expect(r.exit_code).to eq(0)
 | |
|         end
 | |
|       end
 | |
|     end
 | |
| 
 | |
|   end
 | |
| end
 |