Skip to content

Commit

Permalink
test(config): the daemon 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 daemon configuration file.
  • Loading branch information
baby-gnu committed Jul 31, 2019
1 parent 9b9fa1e commit 840c225
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Overide by OS
case os[:family]
when 'arch', 'suse'
config_filename = '/etc/dhcpd.conf'
when 'debian'
config_filename = '/etc/dhcp/dhcpd.conf'
when 'freebsd'
config_filename = '/usr/local/etc/dhcpd.conf'
when 'redhat'
config_filename = '/etc/dhcp/dhcpd.conf'
end

control 'DHCPD 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 840c225

Please sign in to comment.