Skip to content

Commit

Permalink
Merge pull request #212 from baby-gnu/refactor/inspec-best-practices
Browse files Browse the repository at this point in the history
style(inspec): match current practices for file and control names
  • Loading branch information
dafyddj authored Feb 11, 2021
2 parents 4bc10bf + aa8a58b commit 4777a08
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/*/_mapdata/ @saltstack-formulas/ssf
/*/libsaltcli.jinja @saltstack-formulas/ssf
/*/libtofs.jinja @saltstack-formulas/ssf
/test/integration/**/_mapdata_spec.rb @saltstack-formulas/ssf
/test/integration/**/_mapdata.rb @saltstack-formulas/ssf
/test/integration/**/libraries/system.rb @saltstack-formulas/ssf
/test/integration/**/inspec.yml @saltstack-formulas/ssf
/test/integration/**/README.md @saltstack-formulas/ssf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'yaml'

control '`map.jinja` YAML dump' do
title 'should match the comparison file'
control 'TEMPLATE._mapdata' do
title '`map.jinja` should match the reference file'

### Method
# The steps below for each file appear convoluted but they are both required
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

control 'TEMPLATE configuration' do
title 'should match desired lines'
control 'TEMPLATE.config.file' do
title 'Verify the configuration file'

describe file('/etc/template-formula.conf') do
it { should be_file }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s

control 'TEMPLATE package' do
title 'should be installed'
control 'TEMPLATE.package.install' do
title 'The required package should be installed'

# Overide by `platform_finger`
package_name =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s

control 'TEMPLATE service' do
impact 0.5
title 'should be running and enabled'
control 'TEMPLATE.service.running' do
title 'The service should be installed, enabled and running'

# Overide by `platform_finger`
service_name =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

control 'TEMPLATE subcomponent configuration' do
title 'should match desired lines'
control 'TEMPLATE.subcomponent.config.file' do
title 'Verify the subcomponent configuration file'

describe file('/etc/TEMPLATE-subcomponent-formula.conf') do
it { should be_file }
Expand Down

0 comments on commit 4777a08

Please sign in to comment.