|
9 | 9 | end |
10 | 10 |
|
11 | 11 | it do |
| 12 | + contain_file('/etc/apt/sources.list.d/datadog-beta.list') |
| 13 | + .with_ensure('absent') |
12 | 14 | contain_file('/etc/apt/sources.list.d/datadog.list')\ |
13 | 15 | .with_content(%r{deb\s+https://apt.datadoghq.com/\s+stable\s+main}) |
14 | 16 | end |
|
18 | 20 | it { should contain_datadog_agent__ubuntu__install_key('A2923DFF56EDA6E76E55E492D3A80E30382E94DE') } |
19 | 21 | it do |
20 | 22 | should contain_file('/etc/apt/sources.list.d/datadog.list')\ |
21 | | - .that_notifies('Exec[datadog_apt-get_update]') |
| 23 | + .that_notifies('exec[datadog_apt-get_update]') |
22 | 24 | end |
23 | 25 | it { should contain_exec('datadog_apt-get_update') } |
24 | 26 |
|
25 | 27 | # it should install the packages |
26 | 28 | it do |
27 | 29 | should contain_package('apt-transport-https')\ |
28 | | - .that_comes_before('File[/etc/apt/sources.list.d/datadog.list]') |
| 30 | + .that_comes_before('file[/etc/apt/sources.list.d/datadog.list]') |
29 | 31 | end |
30 | 32 | it do |
31 | 33 | should contain_package('datadog-agent-base')\ |
32 | 34 | .with_ensure('absent')\ |
33 | | - .that_comes_before('Package[datadog-agent]') |
| 35 | + .that_comes_before('package[datadog-agent]') |
34 | 36 | end |
35 | 37 | it do |
36 | 38 | should contain_package('datadog-agent')\ |
37 | | - .that_requires('File[/etc/apt/sources.list.d/datadog.list]')\ |
38 | | - .that_requires('Exec[datadog_apt-get_update]') |
| 39 | + .that_requires('file[/etc/apt/sources.list.d/datadog.list]')\ |
| 40 | + .that_requires('exec[datadog_apt-get_update]') |
39 | 41 | end |
40 | 42 |
|
41 | 43 | # it should be able to start the service and enable the service by default |
42 | 44 | it do |
43 | 45 | should contain_service('datadog-agent')\ |
44 | | - .that_requires('Package[datadog-agent]') |
| 46 | + .that_requires('package[datadog-agent]') |
| 47 | + end |
| 48 | +end |
| 49 | + |
| 50 | +describe 'datadog_agent::ubuntu::agent6' do |
| 51 | + let(:facts) do |
| 52 | + { |
| 53 | + osfamily: 'debian', |
| 54 | + operatingsystem: 'Ubuntu' |
| 55 | + } |
| 56 | + end |
| 57 | + |
| 58 | + it do |
| 59 | + contain_file('/etc/apt/sources.list.d/datadog.list') |
| 60 | + .with_ensure('absent') |
| 61 | + contain_file('/etc/apt/sources.list.d/datadog-beta.list')\ |
| 62 | + .with_content(%r{deb\s+https://apt.datadoghq.com/\s+beta\s+main}) |
| 63 | + end |
| 64 | + |
| 65 | + # it should install the mirror |
| 66 | + it { should contain_datadog_agent__ubuntu__install_key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') } |
| 67 | + it { should contain_datadog_agent__ubuntu__install_key('A2923DFF56EDA6E76E55E492D3A80E30382E94DE') } |
| 68 | + |
| 69 | + it do |
| 70 | + should contain_file('/etc/apt/sources.list.d/datadog-beta.list')\ |
| 71 | + .that_notifies('exec[datadog_apt-get_update]') |
| 72 | + end |
| 73 | + it { should contain_exec('datadog_apt-get_update') } |
| 74 | + |
| 75 | + # it should install the packages |
| 76 | + it do |
| 77 | + should contain_package('apt-transport-https')\ |
| 78 | + .that_comes_before('file[/etc/apt/sources.list.d/datadog-beta.list]') |
| 79 | + end |
| 80 | + it do |
| 81 | + should contain_package('datadog-agent-base')\ |
| 82 | + .with_ensure('absent')\ |
| 83 | + .that_comes_before('package[datadog-agent]') |
| 84 | + end |
| 85 | + it do |
| 86 | + should contain_package('datadog-agent')\ |
| 87 | + .that_requires('file[/etc/apt/sources.list.d/datadog-beta.list]')\ |
| 88 | + .that_requires('exec[datadog_apt-get_update]') |
| 89 | + end |
| 90 | + |
| 91 | + # it should be able to start the service and enable the service by default |
| 92 | + it do |
| 93 | + should contain_service('datadog-agent')\ |
| 94 | + .that_requires('package[datadog-agent]') |
45 | 95 | end |
46 | 96 | end |
0 commit comments