From eb3c948199a0f8222f313a5caf683c0252c52f84 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Wed, 31 Jul 2019 15:43:44 +0200 Subject: [PATCH] test(service): the service configuration file must exist * test/integration/default/controls/config_spec.rb: simple checks on the service configuration file. --- test/integration/default/controls/config_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/default/controls/config_spec.rb index c87d1e2..70b2678 100644 --- a/test/integration/default/controls/config_spec.rb +++ b/test/integration/default/controls/config_spec.rb @@ -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 @@ -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