-
-
Notifications
You must be signed in to change notification settings - Fork 500
/
Copy pathparameter_spec.rb
63 lines (53 loc) · 1.61 KB
/
parameter_spec.rb
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'rabbitmq parameter on a vhost:' do
context 'create parameter resource' do
it 'runs successfully' do
pp = <<-EOS
class { 'rabbitmq':
service_manage => true,
port => 5672,
delete_guest_user => true,
admin_enable => true,
}
rabbitmq_plugin { [ 'rabbitmq_federation_management', 'rabbitmq_federation' ]:
ensure => present
} ~> Service['rabbitmq-server']
rabbitmq_vhost { 'fedhost':
ensure => present,
} ->
rabbitmq_parameter { 'documentumFed@fedhost':
component_name => 'federation-upstream',
value => {
'uri' => 'amqp://server',
'expires' => '3600000',
},
}
EOS
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
it 'has the parameter' do
shell('rabbitmqctl list_parameters -p fedhost') do |r|
expect(r.stdout).to match(%r{federation-upstream.*documentumFed.*expires.*3600000})
expect(r.exit_code).to be_zero
end
end
end
context 'destroy parameter resource' do
it 'runs successfully' do
pp = <<-EOS
rabbitmq_parameter { 'documentumFed@fedhost':
ensure => absent,
}
EOS
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
it 'does not have the parameter' do
shell('rabbitmqctl list_parameters -q') do |r|
expect(r.stdout).not_to match(%r{documentumFed\s+})
end
end
end
end