diff --git a/test/integration/default/controls/archive_spec.rb b/test/integration/default/controls/archive_spec.rb index d2f2c6c..fc4bcdb 100644 --- a/test/integration/default/controls/archive_spec.rb +++ b/test/integration/default/controls/archive_spec.rb @@ -3,6 +3,14 @@ control 'prometheus components' do title 'should be installed' + service_dir = + case platform[:family] + when 'debian' + '/lib/systemd/system' + else + '/usr/lib/systemd/system' + end + # describe package('cron') do # it { should be_installed } # not available on amazonlinux? # end @@ -39,7 +47,7 @@ control 'prometheus components' do it { should exist } its('group') { should eq 'prometheus' } end - describe file('/usr/lib/systemd/system/prometheus.service') do + describe file("#{service_dir}/prometheus.service") do it { should exist } its('group') { should eq 'root' } its('mode') { should cmp '0644' } @@ -56,7 +64,7 @@ control 'prometheus components' do it { should exist } its('group') { should eq 'alertmanager' } end - describe file('/usr/lib/systemd/system/alertmanager.service') do + describe file("#{service_dir}/alertmanager.service") do it { should exist } its('group') { should eq 'root' } its('mode') { should cmp '0644' } @@ -73,7 +81,7 @@ control 'prometheus components' do it { should exist } its('group') { should eq 'node_exporter' } end - describe file('/usr/lib/systemd/system/node_exporter.service') do + describe file("#{service_dir}/node_exporter.service") do it { should exist } its('group') { should eq 'root' } its('mode') { should cmp '0644' } diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index a05a1ef..1dee3c9 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -93,7 +93,7 @@ prometheus: archive: source_hash: b2503fd932f85f4e5baf161268854bf5d22001869b84f00fd2d1f57b51b72424 service: - # name: prometheus-node-exporter + name: node_exporter args: web.listen-address: ":9110" # collector.textfile.directory: /var/tmp/node_exporter