InSpec으로 테스트를 만들고 있습니다. 그것은 아파치에 대한 나의 시험이다 :InSpec으로 컨텍스트를 만드는 방법은 무엇입니까?
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
내 질문은 문맥과 관련있다. InSpec을 사용하기 전에 ChefSpec을 사용했고 컨텍스트를 만드는 방법과 출력이 컨텍스트를 표시하는 방법을 좋아합니다. 출력 위의 예를 들어 이것이다 :
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
내가 알고 내 테스트에 대한보다 명확한 결과를 얻기 위해 출력에 가족의 맛 또는 버전 또는 아치를 포함 할 것입니다.
의견이 있으십니까?
나는 당신이'control'을 찾고 있다고 생각한다. [documentation] (http://inspec.io/docs/reference/dsl_inspec/)를 보라. – Tensibai