File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ class { 'erlang': epel_enable => true}
8383 }
8484 EOS
8585
86-
8786 apply_manifest ( pp_pre , :catch_failures => true )
8887 apply_manifest ( pp , :catch_failures => true )
8988 end
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ require 'spec_helper_acceptance'
2+
3+ describe 'rabbitmq policy on a vhost:' do
4+
5+
6+ context "create policy resource" do
7+ it 'should run successfully' do
8+ pp = <<-EOS
9+ if $::osfamily == 'RedHat' {
10+ class { 'erlang': epel_enable => true }
11+ Class['erlang'] -> Class['::rabbitmq']
12+ }
13+ class { '::rabbitmq':
14+ service_manage => true,
15+ port => '5672',
16+ delete_guest_user => true,
17+ admin_enable => true,
18+ } ->
19+
20+ rabbitmq_vhost { 'myhost':
21+ ensure => present,
22+ } ->
23+
24+ rabbitmq_policy { 'ha-all@myhost':
25+ pattern => '.*',
26+ priority => 0,
27+ applyto => 'all',
28+ definition => {
29+ 'ha-mode' => 'all',
30+ 'ha-sync-mode' => 'automatic',
31+ },
32+ }
33+ EOS
34+
35+ apply_manifest ( pp , :catch_failures => true )
36+ end
37+
38+ describe command ( 'rabbitmqctl list_policies -p myhost' ) do
39+ its ( :stdout ) { should match /myhost/ }
40+ its ( :stdout ) { should match /ha-all/ }
41+ its ( :stdout ) { should match /ha-sync-mode/ }
42+ its ( :stdout ) { should match /\. \* / }
43+ end
44+
45+ end
46+ end
Original file line number Diff line number Diff line change 1+ require 'spec_helper_acceptance'
2+
3+ describe 'rabbitmq user:' do
4+
5+
6+ context "create user resource" do
7+ it 'should run successfully' do
8+ pp = <<-EOS
9+ if $::osfamily == 'RedHat' {
10+ class { 'erlang': epel_enable => true }
11+ Class['erlang'] -> Class['::rabbitmq']
12+ }
13+ class { '::rabbitmq':
14+ service_manage => true,
15+ port => '5672',
16+ delete_guest_user => true,
17+ admin_enable => true,
18+ } ->
19+
20+ rabbitmq_user { 'dan':
21+ admin => true,
22+ password => 'bar',
23+ }
24+ EOS
25+
26+ apply_manifest ( pp , :catch_failures => true )
27+ end
28+
29+ describe command ( 'rabbitmqctl list_users | grep dan' ) do
30+ its ( :stdout ) { should match /dan/ }
31+ its ( :stdout ) { should match /administrator/ }
32+ end
33+
34+ end
35+ end
Original file line number Diff line number Diff line change 1+ require 'spec_helper_acceptance'
2+
3+ describe 'rabbitmq vhost:' do
4+
5+
6+ context "create vhost resource" do
7+ it 'should run successfully' do
8+ pp = <<-EOS
9+ if $::osfamily == 'RedHat' {
10+ class { 'erlang': epel_enable => true }
11+ Class['erlang'] -> Class['::rabbitmq']
12+ }
13+ class { '::rabbitmq':
14+ service_manage => true,
15+ port => '5672',
16+ delete_guest_user => true,
17+ admin_enable => true,
18+ } ->
19+
20+ rabbitmq_vhost { 'myhost':
21+ ensure => present,
22+ }
23+ EOS
24+
25+ apply_manifest ( pp , :catch_failures => true )
26+ end
27+
28+ describe command ( 'rabbitmqctl list_vhosts | grep myhost' ) do
29+ its ( :stdout ) { should match /myhost/ }
30+ end
31+
32+ end
33+ end
You can’t perform that action at this time.
0 commit comments