-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathdatadog_agent__install_integration_spec.rb
More file actions
68 lines (57 loc) · 2.07 KB
/
datadog_agent__install_integration_spec.rb
File metadata and controls
68 lines (57 loc) · 2.07 KB
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
64
65
66
67
68
require 'spec_helper'
describe 'datadog_agent::install_integration' do
context 'all supported operating systems' do
ALL_OS.each do |operatingsystem|
let(:facts) do
{
operatingsystem: operatingsystem,
osfamily: getosfamily(operatingsystem),
operatingsystemrelease: getosrelease(operatingsystem),
}
end
if WINDOWS_OS.include?(operatingsystem)
let(:agent_binary) { 'C:/Program Files/Datadog/Datadog Agent/embedded/agent.exe' }
else
let(:agent_binary) { '/opt/datadog-agent/bin/agent/agent' }
end
describe 'installing a core integration' do
let(:pre_condition) { "class {'::datadog_agent': }" }
let(:title) { 'test' }
let(:params) do
{
integration_name: 'datadog-mongo',
version: '1.9.0',
}
end
it { is_expected.to compile }
it { is_expected.to contain_exec('install datadog-mongo==1.9.0').with_command("#{agent_binary} integration install datadog-mongo==1.9.0") }
end
describe 'installing a third-party integration' do
let(:pre_condition) { "class {'::datadog_agent': }" }
let(:title) { 'test' }
let(:params) do
{
integration_name: 'datadog-aqua',
version: '1.0.0',
third_party: true,
}
end
it { is_expected.to compile }
it { is_expected.to contain_exec('install datadog-aqua==1.0.0').with_command("#{agent_binary} integration install --third-party datadog-aqua==1.0.0") }
end
describe 'removing an integration' do
let(:pre_condition) { "class {'::datadog_agent': }" }
let(:title) { 'test' }
let(:params) do
{
integration_name: 'datadog-mongo',
version: '1.9.0',
ensure: 'absent',
}
end
it { is_expected.to compile }
it { is_expected.to contain_exec('remove datadog-mongo==1.9.0').with_command("#{agent_binary} integration remove datadog-mongo==1.9.0") }
end
end
end
end