-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for ntp recipe, doc updates
Fixes #182
- Loading branch information
1 parent
c591741
commit f2718c3
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../helpers/serverspec/Gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ntp.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' => [ | ||
{ | ||
'offset_threshold' => 600, | ||
'host' => 'europe.pool.ntp.org', | ||
'port' => 9999, | ||
'version' => 4, | ||
'timeout' => 10 | ||
} | ||
], | ||
'init_config' => nil | ||
} | ||
|
||
expect(generated.to_json).to be_json_eql expected.to_json | ||
end | ||
end |