Skip to content

Commit

Permalink
test: add test for config_files
Browse files Browse the repository at this point in the history
  • Loading branch information
daks committed Dec 19, 2019
1 parent 69308a0 commit 2854d1b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,18 @@ suites:
base:
'*':
- rabbitmq
- rabbitmq.config_files
pillars:
top.sls:
base:
'*':
- rabbitmq
pillars_from_files:
rabbitmq.sls: pillar.example
dependencies:
- name: files
path: ./test/salt

verifier:
inspec_tests:
- path: test/integration/default
Expand All @@ -198,13 +203,17 @@ suites:
base:
'*':
- rabbitmq.latest
- rabbitmq.config_files
pillars:
top.sls:
base:
'*':
- rabbitmq
pillars_from_files:
rabbitmq.sls: pillar.example
dependencies:
- name: files
path: ./test/salt
verifier:
inspec_tests:
- path: test/integration/default
11 changes: 11 additions & 0 deletions test/integration/default/controls/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

control 'rabbitmq configuration' do
title 'should match desired lines'

describe file('/etc/rabbitmq/rabbitmq.conf') do
it { should exist }
it { should be_file }
its('content') { should include '# Config file for rabbitmq' }
end
end
1 change: 1 addition & 0 deletions test/salt/files/rabbitmq/rabbitmq.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Config file for rabbitmq

0 comments on commit 2854d1b

Please sign in to comment.