File: rabbitmq_spec.rb

package info (click to toggle)
puppet-module-openstacklib 25.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: ruby: 4,500; python: 38; sh: 22; makefile: 10
file content (43 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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