Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for chef-server-running.json #1304

Merged
merged 6 commits into from
Jun 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pedant] Add specs for analytics-required config exports
Signed-off-by: Steven Danna <[email protected]>
stevendanna committed Jun 13, 2017

Verified

This commit was signed with the committer’s verified signature.
stevendanna Steven Danna
commit 6e01c4a261f823dc477644266eee323b7c6fc4f4
48 changes: 48 additions & 0 deletions oc-chef-pedant/spec/running_configs/analytics_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require 'json'
require 'pedant/rspec/common'

describe 'running configs required by Analytics Server', :config do
#
# The analyics add-on reads from actions-source.json which is only
# written out in some configurations.
#
running_config = JSON.parse(IO.read('/etc/opscode/chef-server-running.json'))
if running_config['insecure_addon_compat'] && running_config['darklaunch']['actions']
skip 'Analytics config is only written when insecure_addon_compat = true && darklaunch["actions"] = true'
else
let(:actions_source) { JSON.parse(IO.read('/etc/opscode-analytics/actions-source.json')) }
let(:config) { actions_source['private_chef'] }

it 'api_fqdn' do
expect(config['api_fqdn'].to_s).to_not eq('')
end

it 'oc_id_application' do
expect(config['oc_id_application'].class).to eq(Hash)
end

it 'rabbitmq_host' do
expect(config['rabbitmq_host'].to_s).to_not eq('')
end

it 'rabbitmq_port' do
expect(config['rabbitmq_port'].to_i).to_not eq(0)
end

it 'rabbitmq_vhost' do
expect(config['rabbitmq_vhost'].to_s).to_not eq('')
end

it 'rabbitmq_exchange' do
expect(config['rabbitmq_exchange'].to_s).to_not eq('')
end

it 'rabbitmq_user' do
expect(config['rabbitmq_user'].to_s).to_not eq('')
end

it 'rabbitmq_password' do
expect(config['rabbitmq_password'].to_s).to_not eq('')
end
end
end