2015-10-21 10:56:45 +00:00
|
|
|
# use basic tests
|
2019-06-11 22:24:35 +00:00
|
|
|
describe package("nginx") do
|
2015-10-21 10:56:45 +00:00
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
|
|
|
# extend tests with metadata
|
2019-06-11 22:24:35 +00:00
|
|
|
control "01" do
|
2015-10-21 10:56:45 +00:00
|
|
|
impact 0.7
|
2019-06-11 22:24:35 +00:00
|
|
|
title "Verify nginx service"
|
|
|
|
desc "Ensures nginx service is up and running"
|
|
|
|
describe service("nginx") do
|
2015-10-21 10:56:45 +00:00
|
|
|
it { should be_enabled }
|
|
|
|
it { should be_installed }
|
|
|
|
it { should be_running }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# implement os dependent tests
|
2019-06-11 22:24:35 +00:00
|
|
|
web_user = "www-data"
|
|
|
|
web_user = "nginx" if os[:family] == "centos"
|
2015-10-21 10:56:45 +00:00
|
|
|
|
|
|
|
describe user(web_user) do
|
|
|
|
it { should exist }
|
|
|
|
end
|