Skip to content

Commit

Permalink
Add Testkitchen test.
Browse files Browse the repository at this point in the history
  • Loading branch information
darron committed Sep 29, 2015
1 parent b23a020 commit 520f540
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ suites:
- dskDevice
- ifName

- name: datadog_consul
run_list:
- recipe[datadog::consul]
attributes:
datadog:
<<: *DATADOG
consul:
instances:
- url: http://localhost:8500
new_leader_checks: false
catalog_checks: false
service_whitelist: consul
tags: ['_default']

- name: datadog_cassandra
run_list:
- recipe[datadog::cassandra]
Expand Down
1 change: 1 addition & 0 deletions test/integration/datadog_consul/serverspec/Gemfile
36 changes: 36 additions & 0 deletions test/integration/datadog_consul/serverspec/consul_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Encoding: utf-8
require 'json_spec'
require 'serverspec'
require 'yaml'

set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'

AGENT_CONFIG = '/etc/dd-agent/conf.d/consul.yaml'

describe service('datadog-agent') do
it { should be_running }
end

describe file(AGENT_CONFIG) do
it { should be_a_file }

it 'is valid yaml matching input values' do
generated = YAML.load_file(AGENT_CONFIG)

expected = {
'instances' => [
{
'url' => 'http://localhost:8500',
'new_leader_checks' => false,
'catalog_checks' => false,
'service_whitelist' => 'consul',
'tags' => ['_default']
}
],
'init_config' => nil
}

expect(generated.to_json).to be_json_eql expected.to_json
end
end

0 comments on commit 520f540

Please sign in to comment.