|
1591 | 1591 | end |
1592 | 1592 |
|
1593 | 1593 | config_dir = WINDOWS_OS.include?(operatingsystem) ? 'C:/ProgramData/Datadog' : '/etc/datadog-agent' |
1594 | | - config_yaml_file = config_dir + '/datadog.yaml' |
| 1594 | + config_yaml_file = File.join(config_dir, 'datadog.yaml') |
| 1595 | + install_info_file = File.join(config_dir, 'install_info') |
1595 | 1596 | log_file = WINDOWS_OS.include?(operatingsystem) ? 'C:/ProgramData/Datadog/logs/agent.log' : '\/var\/log\/datadog\/agent.log' |
1596 | 1597 |
|
1597 | 1598 | it { is_expected.to contain_file(config_dir) } |
1598 | 1599 | it { is_expected.to contain_file(config_yaml_file) } |
| 1600 | + it { is_expected.to contain_file(install_info_file) } |
1599 | 1601 | it { is_expected.to contain_file(config_dir + '/conf.d').with_ensure('directory') } |
1600 | 1602 |
|
1601 | 1603 | # Agent 5 files |
1602 | 1604 | it { is_expected.not_to contain_file('/etc/dd-agent') } |
1603 | 1605 | it { is_expected.not_to contain_concat('/etc/dd-agent/datadog.conf') } |
1604 | 1606 | it { is_expected.not_to contain_file('/etc/dd-agent/conf.d').with_ensure('directory') } |
1605 | 1607 |
|
| 1608 | + describe 'install_info check' do |
| 1609 | + let!(:install_info) do |
| 1610 | + contents = catalogue.resource('file', install_info_file).send(:parameters)[:content] |
| 1611 | + YAML.safe_load(contents) |
| 1612 | + end |
| 1613 | + |
| 1614 | + it 'adds an install_info' do |
| 1615 | + expect(install_info['install_method']).to match( |
| 1616 | + 'tool' => 'puppet', |
| 1617 | + 'tool_version' => %r{^puppet-(\d+\.\d+\.\d+|unknown)$}, |
| 1618 | + 'installer_version' => %r{^datadog_module-\d+\.\d+\.\d+$}, |
| 1619 | + ) |
| 1620 | + end |
| 1621 | + end |
| 1622 | + |
1606 | 1623 | describe 'agent6 parameter check' do |
1607 | 1624 | context 'with defaults' do |
1608 | 1625 | context 'for basic beta settings' do |
|
0 commit comments