Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
762B

  1. # frozen_string_literal: true
  2. require 'yaml'
  3. control '`map.jinja` YAML dump' do
  4. title 'should match the comparison file'
  5. # Strip the `platform[:finger]` version number down to the "OS major release"
  6. mapdata_file = "_mapdata/#{system.platform[:finger].split('.').first}.yaml"
  7. # Load the mapdata from profile https://docs.chef.io/inspec/profiles/#profile-files
  8. mapdata_dump = YAML.safe_load(inspec.profile.file(mapdata_file))
  9. # Derive the location of the dumped mapdata
  10. output_dir = platform[:family] == 'windows' ? '/temp' : '/tmp'
  11. output_file = "#{output_dir}/salt_mapdata_dump.yaml"
  12. describe 'File content' do
  13. it 'should match profile map data exactly' do
  14. expect(yaml(output_file).params).to eq(mapdata_dump)
  15. end
  16. end
  17. end