Skip to content

Commit

Permalink
test(services): fix path for debian family
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbertoli committed Aug 24, 2020
1 parent 844a77f commit 7c1cdb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions test/integration/default/controls/archive_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -39,7 +47,7 @@
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' }
Expand All @@ -56,7 +64,7 @@
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' }
Expand All @@ -73,7 +81,7 @@
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' }
Expand Down
2 changes: 1 addition & 1 deletion test/salt/pillar/default.sls
Expand Up @@ -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
Expand Down

0 comments on commit 7c1cdb8

Please sign in to comment.