mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
add tests for upstart on centos
...which are failing
This commit is contained in:
parent
489863a7ce
commit
eecb295377
3 changed files with 46 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
# encoding: utf-8
|
||||
# author: Stephan Renatus
|
||||
|
||||
file "/etc/init/upstart-running.conf" do
|
||||
content "exec tail -f /dev/null"
|
||||
end
|
||||
|
||||
file "/etc/init/upstart-enabled-not-running.conf" do
|
||||
content "exec tail -f /dev/null\nstart on networking"
|
||||
end
|
||||
|
||||
file "/etc/init/upstart-enabled-and-running.conf" do
|
||||
content "exec tail -f /dev/null\nstart on networking"
|
||||
end
|
||||
|
||||
%w{ enabled-and-running running }.each do |srv|
|
||||
service "upstart-#{srv}" do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action :start
|
||||
end
|
||||
end
|
|
@ -13,4 +13,5 @@ when 'ubuntu'
|
|||
when 'centos'
|
||||
# install runit for alternative service mgmt
|
||||
include_recipe 'os_prepare::_runit_service_centos'
|
||||
include_recipe 'os_prepare::_upstart_service_centos'
|
||||
end
|
||||
|
|
|
@ -78,4 +78,28 @@ if os[:family] == 'centos'
|
|||
it { should_not be_installed }
|
||||
it { should_not be_running }
|
||||
end
|
||||
|
||||
describe upstart_service('upstart-running') do
|
||||
it { should_not be_enabled }
|
||||
it { should be_installed }
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
describe upstart_service('upstart-enabled-and-running') do
|
||||
it { should be_enabled }
|
||||
it { should be_installed }
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
describe upstart_service('upstart-enabled-not-running') do
|
||||
it { should be_enabled }
|
||||
it { should be_installed }
|
||||
it { should_not be_running }
|
||||
end
|
||||
|
||||
describe upstart_service('unknown') do
|
||||
it { should_not be_enabled }
|
||||
it { should_not be_installed }
|
||||
it { should_not be_running }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue