I am creating my tests with InSpec. It is my test for Apache:
require 'inspec'
if os[:family] == 'redhat'
describe package 'httpd' do
it { should be_installed }
end
describe service 'httpd' do
it { should be_enabled }
it { should be_running }
end
describe file '/etc/httpd/conf/httpd.conf' do
it { should be_file }
end
end
describe port(80) do
it { should_not be_listening }
end
describe port(9000) do
it { should be_listening }
end
My question is related with context. Before InSpec I used ChefSpec and I like how you can create context and the output show your context. For the example above the output is this:
System Package
✔ httpd should be installed
Service httpd
✔ should be enabled
✔ should be running
File /etc/httpd/conf/httpd.conf
✔ should be file
Port 80
✔ should not be listening
Port 9000
✔ should be listening
I will like to include the family flavor or version or arch in the output in order to know and get a more clear output for my tests.
Any suggestion?