]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/openstacklib/spec/acceptance/rabbitmq_spec.rb
try with modules from master
[dsa-puppet.git] / 3rdparty / modules / openstacklib / spec / acceptance / rabbitmq_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'openstacklib class' do
4
5   context 'default parameters' do
6
7     it 'should work with no errors' do
8       pp= <<-EOS
9       Exec { logoutput => 'on_failure' }
10
11       if $::osfamily == 'RedHat' {
12         # RabbitMQ is not available in default repo
13         class { '::openstack_extras::repo::redhat::redhat':
14           # Kilo is not GA yet, so let's use the testing repo
15           manage_rdo => false,
16           repo_hash  => {
17             'rdo-kilo-testing' => {
18               'baseurl'  => 'https://repos.fedorapeople.org/repos/openstack/openstack-kilo/testing/el7/',
19               # packages are not GA so not signed
20               'gpgcheck' => '0',
21               'priority' => 97,
22             },
23           },
24         }
25         $package_provider = 'yum'
26       } else {
27         $package_provider = 'apt'
28       }
29
30       class { '::rabbitmq':
31         delete_guest_user => true,
32         package_provider  => $package_provider
33       }
34
35       # openstacklib resources
36       include ::openstacklib::openstackclient
37
38       ::openstacklib::messaging::rabbitmq { 'beaker':
39         userid   => 'beaker',
40         is_admin => true,
41       }
42       EOS
43
44       # Run it twice and test for idempotency
45       apply_manifest(pp, :catch_failures => true)
46       apply_manifest(pp, :catch_changes => true)
47     end
48
49     describe 'test rabbitmq resources' do
50       it 'should list rabbitmq beaker resources' do
51         shell('rabbitmqctl list_users') do |r|
52           expect(r.stdout).to match(/^beaker/)
53           expect(r.stdout).not_to match(/^guest/)
54           expect(r.exit_code).to eq(0)
55         end
56
57         shell('rabbitmqctl list_permissions') do |r|
58           expect(r.stdout).to match(/^beaker\t\.\*\t\.\*\t\.\*$/)
59           expect(r.exit_code).to eq(0)
60         end
61       end
62     end
63
64   end
65 end