Skip to content

Commit

Permalink
test(service): the service configuration file must exist
Browse files Browse the repository at this point in the history
* test/integration/default/controls/config_spec.rb: simple checks on
  the service configuration file.
  • Loading branch information
baby-gnu committed Jul 31, 2019
1 parent 840c225 commit eb3c948
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
config_filename = '/etc/dhcpd.conf'
when 'debian'
config_filename = '/etc/dhcp/dhcpd.conf'
service_config_filename = '/etc/default/isc-dhcp-server'
when 'freebsd'
config_filename = '/usr/local/etc/dhcpd.conf'
service_config_filename = '/etc/rc.conf.d/dhcpd'
when 'redhat'
config_filename = '/etc/dhcp/dhcpd.conf'
end
Expand All @@ -20,3 +22,14 @@
its('mode') { should cmp '0644' }
end
end

control 'DHCPD service configuration' do
title 'should be generated properly'

describe file(config_filename) do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
end
end

0 comments on commit eb3c948

Please sign in to comment.