Skip to content

Commit

Permalink
Updating rspec tests for ssl_version changes, whitespace and rabbitmq…
Browse files Browse the repository at this point in the history
…_management version block
  • Loading branch information
dalees committed Jan 29, 2015
1 parent 4dcfdf5 commit ae66ee8
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
should contain_file('rabbitmq.config').with_content(%r{certfile,"/path/to/cert"})
should contain_file('rabbitmq.config').with_content(%r{keyfile,"/path/to/key})
should contain_file('rabbitmq.config').with_content(%r{ssl, \[\{versions, \['tlsv1.1', 'tlsv1.2'\]\}\]})
should contain_file('rabbitmq.config').with_content(%r{versions, \['tlsv1.1', 'tlsv1.2'\]})
end
end

Expand Down Expand Up @@ -552,6 +553,29 @@
end
end

describe 'ssl admin options with specific ssl versions' do
let(:params) {
{ :ssl => true,
:ssl_management_port => 5926,
:ssl_cacert => '/path/to/cacert',
:ssl_cert => '/path/to/cert',
:ssl_key => '/path/to/key',
:ssl_versions => ['tlsv1.2', 'tlsv1.1'],
:admin_enable => true
} }

it 'should set admin ssl opts to specified values' do
should contain_file('rabbitmq.config').with_content(%r{rabbitmq_management, \[})
should contain_file('rabbitmq.config').with_content(%r{listener, \[})
should contain_file('rabbitmq.config').with_content(%r{port, 5926\}})
should contain_file('rabbitmq.config').with_content(%r{ssl, true\}})
should contain_file('rabbitmq.config').with_content(%r{ssl_opts, \[\{cacertfile, "/path/to/cacert"\},})
should contain_file('rabbitmq.config').with_content(%r{certfile, "/path/to/cert"\},})
should contain_file('rabbitmq.config').with_content(%r{keyfile, "/path/to/key"\}})
should contain_file('rabbitmq.config').with_content(%r{,\{versions, \['tlsv1.1', 'tlsv1.2'\]\}[\r\n ]*\]\}})
end
end

describe 'ssl admin options' do
let(:params) {
{ :ssl => true,
Expand All @@ -569,7 +593,7 @@
should contain_file('rabbitmq.config').with_content(%r{ssl, true\}})
should contain_file('rabbitmq.config').with_content(%r{ssl_opts, \[\{cacertfile, "/path/to/cacert"\},})
should contain_file('rabbitmq.config').with_content(%r{certfile, "/path/to/cert"\},})
should contain_file('rabbitmq.config').with_content(%r{keyfile, "/path/to/key"\}\]\}})
should contain_file('rabbitmq.config').with_content(%r{keyfile, "/path/to/key"\}[\r\n ]*\]\}})
end
end

Expand Down Expand Up @@ -604,7 +628,7 @@
should contain_file('rabbitmq.config').with_content(%r{ssl, true\},})
should contain_file('rabbitmq.config').with_content(%r{ssl_opts, \[\{cacertfile, "/path/to/cacert"\},})
should contain_file('rabbitmq.config').with_content(%r{certfile, "/path/to/cert"\},})
should contain_file('rabbitmq.config').with_content(%r{keyfile, "/path/to/key"\}\]\}})
should contain_file('rabbitmq.config').with_content(%r{keyfile, "/path/to/key"\}[\r\n ]*\]\}})
end
end

Expand Down

0 comments on commit ae66ee8

Please sign in to comment.